为什么我不能计算平均分 总分啊 它输入完直接跳出来了
string[] name = new string[5];
int[] score = new int[5];
for (int i = 0; i < name.Length; i++)
{
Console.Write("请输入第" + (i + 1) + "位同学的姓名:");
name[i] = Console.ReadLine();
Console.Write("请输入第" + (i + 1) + "位同学的分数:");
score[i] = int.Parse(Console.ReadLine());
}
int sum = 0, avg;
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
avg = sum / score.Length;
Console.WriteLine("总分是{0},平均分是{1}", sum, avg);