string[] name = new string[] { "景珍", "林惠洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三明" };
int[] Score = new int[]{ 90, 65, 88, 70, 46, 81, 100, 68 };
int Avg=0, Sum = 0;
for (int i = 0;i<Score.Length; i++)
{
Sum+= Score[i];
Avg = Sum / Score.Length;
}
Console.Write("平均分是" + Avg + ",高于平均分的有:");
for(int i=0;i<Score.Length;i++)
{
if(Avg<=Score[i])
{
Console.Write(name[i]+" ");
}
}
这一句Avg = Sum / Score.Length;应该在第一个for循环的外面
中文的逗号
高于平均分前面的逗号是中文逗号。