for (int x = 0; x < 12 ; x++ )//请填写代码
{
Console.WriteLine((x + 1) + " ");
}
{
Console.WriteLine((x + 1) + " ");
}
2018-02-27
贼简单,在21行直接加入
else
Console.WriteLine("6");就行了.因为第一个if语句没有对应else,直接添加上就可以
else
Console.WriteLine("6");就行了.因为第一个if语句没有对应else,直接添加上就可以
2018-02-26
for(int x=1;x<8;x++)
{
for(int y=1;y<8;y++)
{
/* if(x==y||x==8-y)
{
Console.Write("O");
}
else
{
Console.Write(".");
}*/
string t = x==y||x==8-y?"O":".";
Console.Write(t);
}
Console.WriteLine();
}
}
}
}
{
for(int y=1;y<8;y++)
{
/* if(x==y||x==8-y)
{
Console.Write("O");
}
else
{
Console.Write(".");
}*/
string t = x==y||x==8-y?"O":".";
Console.Write(t);
}
Console.WriteLine();
}
}
}
}
string[] name = new string[] { "景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
int[] score = new int[] { 90,65,88,70,46,81,100,68 };
int sum = 0;
for (int i = 0; i < name.Length; i++)
{
sum = sum + score[i];
}
int[] score = new int[] { 90,65,88,70,46,81,100,68 };
int sum = 0;
for (int i = 0; i < name.Length; i++)
{
sum = sum + score[i];
}
string[,] data = {{"钱东禹","90"}, {"伏晨", "98"}, {"陈路","56"}};
int tsorc = 0;
string tname = "";
for (int i = 0; i < data.GetLongLength(0); i++)
{
string name = data[i, 0];
int fs = int.Parse(data[i, 1]);
if (tsorc < fs)
{
tsorc = fs;
tname = name;
}
}
Console.Write("分数最高的是" + tname + ",分数是" + tsorc);
int tsorc = 0;
string tname = "";
for (int i = 0; i < data.GetLongLength(0); i++)
{
string name = data[i, 0];
int fs = int.Parse(data[i, 1]);
if (tsorc < fs)
{
tsorc = fs;
tname = name;
}
}
Console.Write("分数最高的是" + tname + ",分数是" + tsorc);