为什么一提价就告诉我检查输出是否匹配,我的结果跟上边的是一样的啊
string []name=new string[]{"景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
int[] score = new int[] { 90, 65, 88, 70, 46, 81, 100, 68 };
int sum = 0,avg;
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
avg = sum / score.Length;
Console.WriteLine("平均分是"+avg+", 高于平均分的有:");
for (int k = 0; k < name.Length; k++)
{
if (score[k] > avg)
Console.Write(name[k]+" ");
}
我看着没问题啊,vs运行也没问题