出问题了(Identifier expected)

来源:6-8 最终项目

AchingImpact

2016-04-15 13:47

http://img.mukewang.com/571080c500011d7901000100.jpg

以下是代码:

using System;
using System.Collections.Generic;
using System.Text;

namespace projAboveAvg
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] N = new string[8] { "景珍","林慧洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三明" };
            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] + " ");
            }
        }
    }
}

错误是这个:

http://img.mukewang.com/5710806000015d4411190216.jpg

写回答 关注

1回答

  • Leticia10033201169
    2016-04-15 20:51:15
    已采纳

    最后一句打印多写了一个点,改成[code]Console.Write(N[cb] + " ");[/code]就好了。

    Aching...

    非常感谢!

    2016-04-15 21:23:38

    共 1 条回复 >

C#开发轻松入门

本门课程是C#语言的入门教程,将带你轻松入门.NET开发

254121 学习 · 1459 问题

查看课程

相似问题