出問(wèn)題了(Identifier expected)
以下是代碼:
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
??????????? string[] N = new string[8] { "景珍","林慧洋", "成蓉", "洪南昌", "龍玉民", "單江開(kāi)", "田武山", "王三明" };
??????????? int[] SCORE = new int[8] {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.Write("平均分是" + avg + ", ");
??????????? Console.WriteLine("高于平均分的有:");
??????????? for (int cb = 0; cb < SCORE.Length; cb++)
??????????? {
??????????????? if (SCORE[cb] > avg)
??????????????????? Console.Write(N.[cb] + " ");
??????????? }
??????? }
??? }
}
錯(cuò)誤是這個(gè):
2016-04-15
最后一句打印多寫(xiě)了一個(gè)點(diǎn),改成[code]Console.Write(N[cb] + " ");[/code]就好了。