来啦来啦交作业!
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
int avg = 0;
int sum = 0;
int[] scores=new int[8]{90,65,88,70,46,81,100,68};
string[] names= new string[8]{"景珍","林惠祥","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
foreach(int x in scores){
sum+=x;
}
avg=sum/(names.Length);
Console.Write("平均分是{0},高于平均分的有:",avg);
for(int i=0;i<scores.Length;i++){
if(scores[i]>avg){
Console.Write(names[i]);
}
}
}
}
}