提交后只出现景珍,提示索引超出数值接线,有大佬回答吗
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
string[,] score={{"景珍","90"},{"林惠洋","65"},{"成蓉","88"},{"洪南昌","70"},{"龙玉民","46"},{"单江开","81"},{"田武山","100"},{"王三明","68"}};
int sum=0,avg;
for(int i=0;i<score.GetLongLength(0);i++)
{
sum +=int.Parse(score[i,1]);
}
avg=sum/score.GetLength(0);
Console.WriteLine("平均分是{0},高于平均分的有:",avg);
for(int x=0;x<score.GetLongLength(0);x++)
{
if(int.Parse(score[x,1])> avg)
Console.Write(score[0,x]+" ");
}
}
}
}