幫忙看看哪里錯(cuò)了?郁悶啊
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
??????????? string[,] Score = new string[2,8]{{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"},{89,90,98,56,60,91,93,85}};
????????? string temp ="0";
????????? for(int i=0;i<8;i++)
????????? {
????????????? if(String.Compare(Score[1,i],temp)>0)
????????????? {
??????????????? temp=Score[1,i];
????????????? }
????????? }
????????? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",Score[0,i-1],Score[1,i-1]);
??????? }
??? }
}
2018-12-03
String.Compare(Score[1,i],temp)>0,大神這句語法什么意思呀
2018-12-01
///終于明白了,改正后代碼如下:各位參考吧。
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
??????????? string[,] Score = new string[2,8]{{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"},{"89","90","98","56","60","91","93","85"}};
????????? string temp ="0",name="";
????????? for(int i=0;i<8;i++)
????????? {
????????????? if(String.Compare(Score[1,i],temp)>0)
????????????? {
??????????????? temp=Score[1,i];
??????????????? name=Score[0,i];
????????????? }
????????? }
????????? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",name,temp);
??????? }
??? }
}