有兄弟告訴我這樣做為什么不對呀
?string[] Name = new string[] { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關欣" };
? ? ? ? ? ? int[] Score = new int[] { 89, 90, 98, 56, 60, 91, 93, 85 };
? ? ? ? ? ? int Max = 0;
? ? ? ? ? ??
? ? ? ? ? ? for (int i = 0; i < Score.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (Score[i] > Max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Max = Score[i];
? ? ? ? ? ? ??
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("分數(shù)最高的是{0},分數(shù)是{1}", Name[i-1],Max);
2022-04-08
你需要再設一個變量去儲存你最大分數(shù)時i的編號。
2022-03-01