帮忙看看谢谢
using System;
namespace Test
{
class Program
{
static void Main(string[] args)
{
int[] score = { 90, 65, 88, 70, 46, 81, 100, 68 };
string[] name = { "景珍", "林慧洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三明" };
double sum = 0;
double avg;
for (int i = 0; i < score.Length; i++)
{
double avg2;
sum += score[i];
//Console.WriteLine(sum);//
avg2 = sum / 8;
if (score[i] > avg2)
{
Console.WriteLine("当前高于平均分的有" + name[i]);
}
}
avg = sum / 8;
Console.Write("平均分为" + avg);
Console.ReadKey();
}
}
}