最后一题,请问下,最后怎么输出 连着的 几个名字?
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
string[] a =new string[8]{
"景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"
};
int[] b = new int[8]{
90,65,88,70,46,81,100,68
};
int i=0;
int avge=0;
int sum=0;
int count=0;
for(i=0;i<b.Length;i++){
sum +=b[i];
count=i+1;
avge=sum/count;
}
for(i=0;i<b.Length;i++){
if(b[i]<=avge){
continue;
}else{
Console.WriteLine("平均分是"+avge+","+"高于平均分的有"+a[i]+"\t");
}
}
}
}
}