如果实战中名字和分数在数组中的位置并没有一一对应时怎么办呢?
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
string[,]arr={{"景珍","90"},{"林慧洋","65"},{"成蓉","88"},{"洪南昌","70"},{"龙玉民","46"},{"单江开","81"},{"田武山","100"},{"王三明","68"},};
int sum=0;
for(int i=0;i<arr.GetLength(0);i++){
sum+=int.Parse(arr[i,1]);
}
int avg=sum/arr.GetLength(0);
Console.Write("平均分是{0},高于平均分的有:",avg);
for(int i=0;i<arr.GetLength(0);i++){
if(int.Parse(arr[i,1])>avg){
Console.Write(arr[i,0]+" ");
}
}
}
}
}