using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
string[] name = new string[] { "景珍", "林惠洋", "成蓉", "洪南昌", "龙玉民", "单江开", "田武山", "王三明" };
int[] score = new int[] { 90, 65, 88, 70, 46, 81, 100, 68 };
int sum = 0;
int avg = 0;
foreach (int j in score)
{
sum += j;
}
avg = sum / score.Length;
Console.WriteLine("平均分是{0}", + avg + ", 高于平均分的有:");
for (int i = 0; i < score.Length; i++)
{
if (score[i] > avg)
Console.Write(name[i] + " ");
}
}
}
}
标准答案上的结果中的逗号和冒号都是中文格式下的“,”和“:”,你这里写的都是英文格式的","和":"。
你到电脑当中的visual studio 当中试试