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();
Console.WriteLine(true||false);//输出True
Console.WriteLine(true && false);//输出False
Console.WriteLine(!false);//输出True
Console.WriteLine(true && false);//输出False
Console.WriteLine(!false);//输出True
2016-01-13