#include <stdio.h>
double HighScore; /*全局变量,最高分*/
double LowScore; /*全局变量,最低分*/
double SumScore; /*全局变量,总分*/
double AverageScore; /*全局变量,平均分*/
void calcscore(int n)
{
int i;
double j;
SumScore=0;
HighScore=-1;
LowScore=100;
for(i=1;i<=n;i++)
{
scanf("%lf",&j);
if(j>HighScore)
{
HighScore=j;}
if(j<LowScore)
{
LowScore=j;}
SumScore+=j;
}
AverageScore=SumScore/n;
} /*函数声明*/
int main()
{
int n;
scanf("%d",&n);
calcscore(n);
printf("%g %g %g %g\n",HighScore,LowScore,SumScore,AverageScore);
return 0;
}
学生成绩管理
最新推荐文章于 2019-06-25 16:21:30 发布