宝慕林4770052
2019-03-08 22:18
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
string[] names = {"景珍","林慧洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
int[] fenshu={90,65,88,70,46,81,100,68};
int zong=0,ping;
for(int i =0;i<fenshu.Length;i++)
{
zong+=fenshu[i];
}
ping=zong/fenshu.Length;
Console.Write("平均分是{0},高于平均分的有:",ping);
Console.WriteLine(" ");
for (int i = 0; i < fenshu.Length; i++)
{
if (fenshu[i] > ping)
{
Console.Write(names[i]+" ");
}
}
}
}
}
Console.Write("平均分是{0},高于平均分的有:",ping);
这一行代码中的逗号是中文逗号,你打成了英文逗号
C#开发轻松入门
254118 学习 · 1459 问题
相似问题