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"}};
int sum = 0;
double avg = 0;
for (int i = 0; i < name_Score.GetLongLength(0); i++)
{
sum += int.Parse(name_Score[i, 1]);
}
avg = sum / name_Score.GetLongLength(0);
Console.WriteLine("平均分是{0},高于平均分的有:", avg);
for (int j = 0; j < name_Score.GetLongLength(0); j++)
{
if (int.Parse(name_Score[j, 1]) > avg)
{
Console.Write(name_Score[j, 0] + " ");
}
}
}
}
}
Console.WriteLine("平均分是{0},高于平均分的有:", avg);
这句里的冒号修改成: