为了账号安全,请及时绑定邮箱和手机立即绑定

谁知道哪里错了?

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

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


正在回答

2 回答

已解决

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

namespace projGetMaxScore
{
    class Program
    {
        static void Main(string[] args)
        {
           string[,] name_score={{"吴松","89"},{"钱东宇","90"},{"伏晨","98"},{"陈陆","56"},{"周蕊","60"},{"林日鹏","91"},{"何坤","93"},{"关欣","85"}};
           int max=0;
           int x=0;
           for(int i=0;i<name_score.GetLongLength(0);i++){
                if(max < int.Parse(name_score[i,1])){
                   max=int.Parse(name_score[i,1]);
                   x=i;}
              
           }
            Console.WriteLine("分数最高的是{0},分数是{1}",name_score[x,0],name_score[x,1],max);
        }
    }
}


1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
C#开发轻松入门
  • 参与学习       251624    人
  • 解答问题       1448    个

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

进入课程

谁知道哪里错了?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信