记录一下我学习过
string[] name = new string[] { "景珍", "林慧洋", "成蓉", "红南昌", "龙王民", "单开江", "田武山", "王三明" };
int[] score = new int[] { 90,65,88,70,46,81,100,68};
int sum = 0;
for (int i = 0; i < score.Length; i++)//求得总分
{
sum += score[i];
}
double agv = sum / score.Length;//求得平均分
Console.WriteLine("平均分是{0},高于平均分的有:",agv);
for (int i = 0; i < score.Length; i++)
{
if (score[i]>agv)
{
Console.Write(name[i]+" ");
}
}