只用前面學(xué)過的知識(shí)點(diǎn)
string[] name = new string[] { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };
? ? ? ? ? ? int[] score = new int[] { 89, 90, 98, 56, 60, 91, 93, 85 };
? ? ? ? ? ? int maxscore = score[0];
? ? ? ? ? ? string topname = name[0];
? ? ? ? ? ? for (int i = 0; i < score.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (score[i] > maxscore)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? maxscore = score[i];
? ? ? ? ? ? ? ? ? ? topname = name[i];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("分?jǐn)?shù)最高的是{0}" + "," + "分?jǐn)?shù)是{1}", topname, maxscore);