Console.WriteLine("平均分是:{0}",avg);
Console.Write("高于平均分的有:\n");
for (int s = 0;s < score.Length;s++) {
if (score[s] > avg) {
index = s;
Console.Write(name[index] + "\t");
}
}
Console.Write("高于平均分的有:\n");
for (int s = 0;s < score.Length;s++) {
if (score[s] > avg) {
index = s;
Console.Write(name[index] + "\t");
}
}
最新回答 / weixin_慕虎1420592
x++; 在if的执行语句里,当x的值为偶数时,if语句不执行,x的值一直不加1,while (x <= 30)一直执行,程序进入死循环。
2020-03-27