表示不能接受,错哪喽?
static void Main(string[] args)
{
string[]name=new string[]{"景珍","林慧洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
int[]num=new int[]{90,65,88,70,46,81,100,68};
int sum=0;
double avg;
for(i=0;i<=num.Length;i++)
{
sum+=num[i];
}
avg=sum/num.Length;
Console.WriteLine("平均分是"+avg+",高于平均分的有:");
int index;
for (a=0;a<=num.Length;a++)
{
if (num[a]>=avg)
{
index=a;
Console.Write(name[a]+" " );
}
}
}