暈掉,不知道哪里出了問題
??????? static void Main(string[] args)
??????? {
??????????? int[]score=new int[]{89,90,98,56,60,91,93,85};
??????????? string[]names=new string[]{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
??????????? int max=score[0];
??????????? string name=names[0];
??????????? for(int i=0;i<score.Length;i++)
??????????? {
??????????????? if(score[i]>max)
??????????????? {
??????????????????? max=score[i];
??????????????????? name=names[i];
??????????????? }
??????????? }
??????????? Console.Write("分?jǐn)?shù)最高的是"+name+",分?jǐn)?shù)是"+max);
? ? ? ? ? ?
2020-07-21
思維想法真好,受教了!?
2020-06-28
加個Console.ReadLine();吧
2020-03-05
應(yīng)該這個樣子
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int[]score=new int[]{89,90,98,56,60,91,93,85};
? ? ? ? ? ? string[]names=new string[]{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int max=score[0];
? ? ? ? ? ? string name=names[0];
? ? ? ? ? ? for(int i=0;i<score.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(score[i]>max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max=score[i];
? ? ? ? ? ? ? ? ? ? name=names[i];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分?jǐn)?shù)最高的是"+name+",分?jǐn)?shù)是"+max);? ??
? ? ? ? }
? ? }
}
2020-03-01
沒錯,Main()內(nèi)部代碼沒問題,可是你main()括號少一個結(jié)尾花括號
2020-02-29
抱歉,剛才沒看清楚。我復(fù)制你的代碼可以運行出來,沒有錯誤。
2020-02-29
最后一行的代碼有錯誤,應(yīng)該為(加粗的為有錯誤的地方)
Console.Write("分?jǐn)?shù)最高的是"+name+"分?jǐn)?shù)是"+max);
2020-02-29
最后一行的代碼有錯,應(yīng)該為
Console