int[]score={90,65,88,70,46,81,100,68}; string []name ={"景珍","林惠洋","成蓉",...};int sum=0;int avg;for(int x=0;x<score.Length;x++){sum +=score[x]; }avg=sum/score.Length;Console.Write("平均分是{0},高于平均分的有:",avg);for(int y=0;y<score.Length;y++){if(score[y]>avg){Console.Write(name[y]+" "); }}
string[,] exam = { { "吴松", "89" }, { "钱东宇", "90" },...};int max = int.Parse(exam[0, 1]);//第一个同学分数赋给max
int maxi = 0;//找到最高分数对应姓名
for (int x = 0; x < 8; x++) { if (max < int.Parse(exam[x, 1]))
{ max = int.Parse(exam[x, 1]);maxi = x;//获取分数最高
}} Console.Write("分数最高的是{0},分数是{1}", exam[maxi, 0], max);
int maxi = 0;//找到最高分数对应姓名
for (int x = 0; x < 8; x++) { if (max < int.Parse(exam[x, 1]))
{ max = int.Parse(exam[x, 1]);maxi = x;//获取分数最高
}} Console.Write("分数最高的是{0},分数是{1}", exam[maxi, 0], max);