运行成功输出错误啊,也没错啊?
String[] name = { "景珍", "林慧洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三名" };
int[] score = { 90, 65, 88, 70, 49, 81, 100, 68 };
int sum = 0;
string getname = null;
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
double avg = sum / score.Length;
for (int i = 0; i < name.Length; i++)
{
if (score[i] >= avg)
{
getname += name[i] + " ";
}
}
Console.WriteLine("平均分是,"+avg +"高于平均分的有:"+ getname);