运行结果符合要求,但是提示输出错误,那位大侠给诊断一下
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
string[,] name_score = new string[,] { { "景珍", "90" }, { "林惠洋", "65" }, { "成蓉", "88" }, { "洪南昌", "70" }, { "龙玉民", "46" }, { "单江开", "81" }, { "田武山", "100" }, { "王三明", "68" } };
double sum = 0, avg;
for (int i = 0; i<name_score.GetLength(0); ++i)
{
sum += double.Parse(name_score[i, 1]);
}
avg = sum / name_score.GetLength(0);
Console.WriteLine("平均分是{0},高于平均分的有:", avg);
for (int i = 0; i< name_score.GetLength(0); i++)
{
if (avg < double.Parse(name_score[i, 1]))
Console.Write("{0} ",name_score[i, 0]);
}
}
}
}