题解 | #统计成绩#
统计成绩
https://www.nowcoder.com/practice/cad8d946adf64ab3b17a555d68dc0bba
#include <stdio.h> int main() { int n; scanf("%d",&n); double a; double max=0; double min=100; double sum=0; double p=0; for(int i=1;i<=n;i++){ scanf("%lf",&a); max=max>a?max:a; min=min<a?min:a; sum+=a; } p=sum/n; printf("%.2lf %.2lf %.2lf",max,min,p); }