山有木兮木有枝__
2018-07-05 15:49
class program
{
static void Main()
{
string[] name = new string[] { "景珍", "林惠洋", "成蓉", "洪南昌", "龙玉民", "单红开", "田武山", "王三明" };
int[] score = new int[] { 90, 65, 88, 70, 46, 81, 100, 68 };
int sum = 0, vag;
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
vag = sum / score.Length;
Console.Write("平均分是" + vag + ",高于平均分的有:");
for (int i = 0; i < score.Length; i++)
if (score[i] > vag)
{
Console.Write(name[i] + " ");
}
}
}
Console.Write("平均分是" + vag + ",高于平均分的有:");
改为
Console.WriteLine("平均分是" + vag + ",高于平均分的有:");
就好啦
姓名要另起一行
C#开发轻松入门
254117 学习 · 1459 问题
相似问题