慕粉1916207245
2017-03-28 10:17
通过这门课程的学习,我对C#有了初步的了解。然后我又在“我要自学网”上学习了窗体部分的内容,把这个网站推荐给大家,希望对大家有所帮助。 http://www.51zxw.net/study.asp?vip=14202336
非常感谢,一起努力,共同学习!
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;
double avg;
for (int i = 0; i < score.Length; i++)
{
sum += score[i];
}
avg = sum / score.Length;
Console.WriteLine("平均分是" + avg + ",高于平均分的有:");
for (int x = 0; x < score.Length; x++)
{
if(score[x]>avg)
Console.Write(name[x]+" ");
}
}
}
}
C#开发轻松入门
255692 学习 · 1527 问题
相似问题