int x = 5;
int y = 5;
int z = 5;
Console.Write(++x);
Console.Write(++y);
Console.Write(++z);
int y = 5;
int z = 5;
Console.Write(++x);
Console.Write(++y);
Console.Write(++z);
2022-10-14
{if (x >= 5)
{ Console.WriteLine("5");
}
}
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
}
}
{ Console.WriteLine("5");
}
}
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
}
}
2022-09-29
static void Main(string[] args)
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
char text = (j==i || j==6-i)?'O':'.';
Console.Write(text);
}
Console.WriteLine();
}
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
char text = (j==i || j==6-i)?'O':'.';
Console.Write(text);
}
Console.WriteLine();
}
最新回答 / weixin_慕娘0258307
using System;using System.Collections.Generic;using System.Text;namespace projGetMaxScore{ class Program { static void Main(string[] args) { string[,]s={{"吴松","89"},{"钱东宇","90"},{"伏晨","98"},{"陈陆","56"},{"周蕊","60"},{"林日鹏","91"},{...
2022-09-08
string[,] list = new string[,]{{"吴松","89"},{"钱东宇","90"},{"伏晨","98"},{"陈陆","56"},{"周蕊","60"},{"林日鹏","91"},{"何昆","93"},{"关欣","85"}}; string name = ""; int score = 0;for (int i = 0; i < list.GetLength(0)-1; i++) {if (int.Parse(list[i, 1]) > score) {name = list[i, 0];score = int.Parse(list[i, 1]);}};
string[,] nameScoreArr = new string[4,2]{{"吴松","89"},{"钱东","90"},{"周蕊","98"},{"关欣","78"}};
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
最新回答 / 慕工程9249744
using System;using System.Collections.Generic;using System.Text;namespace Test{ class Program { static void Main(string[] args) { double salary = 6000.00;//基本工资 double prize = 3200.00;//奖金 double tax = ...
2022-08-27
switch的方法有点简单,应该再详细说明一下,比如case的的语句块{}以及不加语句块的区别,加了语句块 可以申明局部相同的变量等。。
2022-08-24