求解這哪里錯了,顯示運(yùn)行成功,輸出錯誤
string[]name=new string[8]{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int[] num=new int[]{89,90,98,56,60,91,93,85};
? ? ? ? ? ? int max=num[0];
? ? ? ? ? ? int index=0;
? ? ? ? ? ? for(int x=1;x<num.Length;x++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(num[x]>max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max=num[x];
? ? ? ? ? ? ? ? ? ? index=x;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分?jǐn)?shù)最高的是"+name [index]+","+"分?jǐn)?shù)是"+max);
這哪錯了啊?
2020-12-24
人家讓你輸出平均值和高于平均值的人名有哪些,你輸出的是最高分和分?jǐn)?shù),當(dāng)然是輸出錯誤啊,運(yùn)行成功說明你寫的這段代碼沒問題,可以正常運(yùn)行,但是不是人家想要的。