誰(shuí)知道哪里錯(cuò)了?
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
?????????? string[,] name_score={{"吳松","89"},{"錢(qián)東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{"何坤","93"},{"關(guān)欣","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("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",name_score[x,0],name_score[x,1]);
??????? }
??? }
}
2020-04-16
已解決
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
?????????? string[,] name_score={{"吳松","89"},{"錢(qián)東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{"何坤","93"},{"關(guān)欣","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("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",name_score[x,0],name_score[x,1],max);
??????? }
??? }
}