成绩分析


from lanqiao 11 - F
from acwing 2866
Time limit:1s
Memory limit:256MB

成绩分析_c代码


ac代码:
#include<bits/stdc++.h>
using namespace std;
int n,maxn = 0,minn = 100,x;
double sum;
int main(){
cin>>n;
for(int i = 1;i <= n;++i)
cin>>x,maxn = max(maxn,x),minn = min(minn,x),sum += x;
printf("%d\n%d\n%.2lf",maxn,minn,sum / n);
return 0;
}