在VS上編碼沒(méi)啥問(wèn)題,但是提交作業(yè)不通過(guò)。
string[] name = { "景珍", "林惠洋", "成蓉", "洪南昌", "龍玉民", "單江開(kāi)", "田武山", "王三明" };
? ? ? ? ? ? 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(" ");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
2022-12-07
你好,朋友!
你的問(wèn)題是標(biāo)點(diǎn)符號(hào)不對(duì)
在?",高于平均分的有:\n"一句中英文引號(hào)內(nèi)的逗號(hào)(,)和冒號(hào)(:)都是中文狀態(tài)下,應(yīng)該把它們改成英文狀態(tài)下的逗號(hào)和冒號(hào)。