目測沒錯,這個編譯器有問題。。。?
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
??????????? string[,] result=new string[,]{{"吳松","89"},{"鐵東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{"何昆","93"},{"關(guān)欣","85"}};
??????????? string temp="";
??????????? int maxscore=0;
??????????? for(int i=0;i<result.GetLongLength(0);i++)
??????????? {
??????????????? if(int.Parse(result[i,1])>maxscore)
??????????????? {
??????????????????? temp=result[i,0];
??????????????????? maxscore=int.Parse(result[i,1]);
??????????????? }
??????????? }
????????? Console.WriteLine("分數(shù)最高的是{0},分數(shù)是{1}",temp,maxscore);
??????? }
??? }
}
2016-03-30
你把這段代碼在自己的VisualStudio上運行,運行是成功的。而在案例中運行的時候,顯示錯誤應該是輸出的格式和他要求的不一致,這就是小細節(jié)了要自己找找,看看是不是標點的問題 空格的問題。但這段代碼在VS上是能運行的。
2019-07-01
輸出的逗號是漢語狀態(tài)下的逗號
2016-03-29
第11行代碼最后的分號錯了,改成英文狀態(tài)下的分號。就是聲明result數(shù)組那一行的末尾分號。