運(yùn)行成功 輸出錯(cuò)誤
string [,]nScore=new[,]{{"吳松","89"},{"錢東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{"何昆","93"},{"關(guān)欣","85"}};
??????????? string name="";
??????????? int maxScore=0;
??????????? for (int i=0; i<nScore.GetLength(0);i++)
??????????? {
??????????????? if (maxScore<Convert.ToInt32(nScore[i,1]))
??????????????? {
??????????????? maxScore=Convert.ToInt32(nScore[i,1]);
??????????????? name=nScore[i,0];
??????????????? }
??????????? }
??????????? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",name,maxScore);
2019-05-17
運(yùn)行結(jié)果意思是對(duì)的,結(jié)果有誤是你的標(biāo)點(diǎn)格式與答案不一樣,你換成中文逗號(hào)就可以了
2019-05-14
是對(duì)的,沒問題
2019-05-14
string[,] test = new string[8, 2] { { "吳松", "89" }, { "錢東宇", "90" }, { "伏晨", "98" }, { "陳陸", "56" }, { "周蕊", "60" }, { "林日鵬", "91" }, { "何昆", "93" }, { "關(guān)欣", "85" } };
??????? int max = 0, m = 0;
??????? for (int i = 0; i < test.GetLongLength(0); i++)
??????? {
??????????? int n = Convert.ToInt16(test[i, 1]);
??????????? if (n >= max)
??????????? {
??????????????? max = n;
??????????????? m = i;
??????????? }
??????? }
??????? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}。", test[m, 0], test[m, 1]);