问答详情
源自:6-1 练习题目

想知道哪里有问题,请求各位大佬回答

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

namespace projGetMaxScore
{
    class Program
    {
        static void Main(string[] args)
        {
           
            int[] mark = new []{89,90,98,56,60,91,93,85} ;
            int a = mark[i];
            for(int i=0;i<mark.Length;i++)
              
                if (a>=mark[i])
                   a = a;
                else
                   a = mark[i];
            string[] name = new []{"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
              Console.Write("分数最高的是" + name[i] +"," +"分数是" + mark[i]);
           
           
        }
    }
}


提问者:v狐玖v 2018-09-10 21:14

个回答

  • 阿米巴丶
    2018-09-10 23:03:16
    已采纳

       1.int a = mark[i] 这个有问题;2.for循环也没有大括号;3. Console.Write("分数最高的是" + name[i] +"," +"分数是" + mark[i]);没有记录i,你用取不到下标