想知道哪里有問題哎
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
??? class Program
??? {
??????? static void Main(string[] args)
??????? {
?????????? int[] mark = new []{89,90,98,56,60,91,93,85} ;
?????????? string[] name = new []{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
??????????? int a =0;
??????????? for(int i=0;i<mark.Length;i++)
??????????????
??????????????? if (a<=mark[i])
??????????????????
?????????????????? a = mark[i];
?????????????????? b = name[i];
???????????
????????????? Console.Write("分?jǐn)?shù)最高的是" + b +"," +"分?jǐn)?shù)是" + a);?
??????? }
??? }
}
2018-09-14
是不是IF后面有兩條命令所以要大括號(hào)?
2018-09-11
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ?int[] mark = new []{89,90,98,56,60,91,93,85} ;
? ? ? ? ? ?string[] name = new []{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int a =0;
? ? ? ? ? ? string b="";
? ? ? ? ? ? for(int i=0;i<mark.Length;i++){
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? if (a<=mark[i])
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ?a = mark[i];
? ? ? ? ? ? ? ? ? ?b = name[i];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? ? Console.Write("分?jǐn)?shù)最高的是" + b +"," +"分?jǐn)?shù)是" + a);??
? ? ? ? }
? ? }
}