我很迷...
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? ? ? ? ?string[]
? ? ? ? ? ? ? ?name = new string[] { "吳松", "錢東宇", "伏晨", "陳陸", "林日鵬", "何昆", "關(guān)欣" };
? ? ? ? ? ? ? ? int[] number = new int[] { 89, 90, 98, 56, 60, 91, 93, 85 };
? ? ? ? ? ? ? ? string temp = name[0];
? ? ? ? ? ? ? ? int x = number[0];
? ? ? ? ? ? ? ? for (int i = 0; i <= number.Length; i++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (number[i] > x)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? temp = name[i];
? ? ? ? ? ? ? ? ? ? ? ? x = number[i];
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.Write("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",x,temp);?
? ? ? ? }
? ? }
}
有誰看出問題的
2020-10-06
問題很嚴(yán)重,兩個(gè)數(shù)組成員數(shù)居然不一樣,姓名只有7個(gè),分?jǐn)?shù)有8個(gè)。