using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace consoleapplication1
{
class Program
{
static void Main(string[] args)
{
int[] grade = new int[10];
for (int i = 0; i < 10; i++)
{
string s;
s = Console.ReadLine();
grade[i] = int.Parse(s);
}
int max = grade[0];
int min = grade[0];
int sum = 0;
for (int i = 0; i < 10; i++)
{
if (max < grade[i])
{
max = grade[i];
}
if (min > grade[i])
{
min = grade[i];
}
sum = grade[i] + sum;
}
Console.WriteLine("平均分为:" + (double)sum / 10);
Console.WriteLine("最高分为:" + max);
Console.WriteLine("最低分为:" + min);
Console.ReadKey();
}
}
}
2016年c#实验2.2
最新推荐文章于 2021-09-26 14:16:42 发布