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]);
}
}
}
}
平均分是{0},高于平均分的有: 要用中文逗号?