题解 | #统计成绩#

统计成绩

https://www.nowcoder.com/practice/cad8d946adf64ab3b17a555d68dc0bba

#include <stdio.h>
int main(){
    int n;
    double s,max=0,min=100,sum=0;
    scanf("%d",&n);
    while ((scanf("%lf",&s))!=EOF){
        if(max<s)
            max=s;
        if(min>s)
            min=s;
        sum+=s;
    }
    printf("%.2lf %.2lf %.2lf",max,min,sum/n);
    return 0;
}
全部评论

相关推荐

07-10 13:59
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务