在VS上编码没啥问题,但是提交作业不通过。
string[] name = { "景珍", "林惠洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三明" };
int[] score = { 90, 65, 88, 70, 46, 81, 100, 68 };
int scores=0, avg;
for (int i = 0; i < score.Length; i++)
{
scores += score[i];
}
avg = scores / score.Length;
Console.Write("平均分是" + avg + ",高于平均分的有:\n");
for (int x = 0; x < name.Length; x++)
{
if(score[x]>avg)
{
Console.Write(name[x]);
Console.Write(" ");
}
}