我這個(gè)代碼為什么錯(cuò)了
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? int[]num={89,90,98,56,60,91,93,85};
? ? ? ? string[]XM={"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? int max=num[0];
? ? ? ? string name=XM[0];
? ? ? ? for(int i=0;i<num.Length;i++)
? ? ? ? {
? ? ? ? ? ? if(num[i]>max)
? ? ? ? ? ? {
? ? ? ? ? ? ? max=num[i];
? ? ? ? ? ? ? name=XM[i];??
? ? ? ? ? ? }
? ? ? ? ? ??
? ? ? ? }
? ? ? ? Console.Write("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",name,max);
? ? }
2022-10-18
少了個(gè)}
2022-09-08
應(yīng)該沒問題啊
2022-07-14
聲明數(shù)組的時(shí)候,數(shù)據(jù)類型和變量名要有空格隔開,寫循環(huán)語句的時(shí)候,已經(jīng)先給max和name賦值了數(shù)組的0下標(biāo)的元素,所以在寫for循環(huán)的時(shí)候,int i初值應(yīng)該等于1