还要注释换行符!
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
if(x>y)continue;
Console.Write(x);
}
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
if(x>y)continue;
Console.Write(x);
}
2016-01-16
static void Main(string[] args)
{
string temp;//中间变量
temp=boy;//把男孩的名字赋值给temp
boy=girl;//把女孩的名字赋值给男孩
girl=temp;//把temp中的名字赋值给女孩
Console.WriteLine("男孩叫"+boy+" 女孩叫"+girl);
}
{
string temp;//中间变量
temp=boy;//把男孩的名字赋值给temp
boy=girl;//把女孩的名字赋值给男孩
girl=temp;//把temp中的名字赋值给女孩
Console.WriteLine("男孩叫"+boy+" 女孩叫"+girl);
}
2016-01-14
int avg;int sum;string name = "";for (int i = 0; i < score.Length; i++) {sum += score[i];} avg = sum / score.Length;for (int j = 0; j <score.Length; j++) { if (score[j] > avg){name += names[j] + " "; } } Console.WriteLine("平均分是" + avg + "高于平均分的有:\n" + name); Console.ReadLine();