Console.WriteLine("班级人数");
int count = Convert.ToInt32(Console.ReadLine());
int i = 0;
int sum = 0;
while (i < count) { Console.WriteLine("第{0}个学员的成绩", i + 1);
int score = Convert.ToInt32(Console.ReadLine());
sum += score
; i++;
}
Console.WriteLine("{0}个人的班总成绩是{1}平均成绩是{2}", count, sum, sum / count);
Console.ReadKey();
网友评论