1条回答 默认 最新
- Kappuccinno 2021-10-13 21:52关注
#include <stdio.h> int main() { int score=0,max_p=0,min_p=100; int total_score=0,total_student=0; while (1){ scanf("%d",&score); if (score==-1){ break; } else if (score>100 || score<0){ continue; } else{ if (score>max_p){ max_p=score; } if (score<min_p){ min_p=score; } total_score+=score; total_student++; } } double average=1.0*total_score/total_student; printf("全班一共有学生:%d\n",total_student); printf("全班平均分:%.1f\n",average); printf("全班最高分:%d\n",max_p); printf("全班最低分:%d",min_p); }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 11无用 4
悬赏问题
- ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
- ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
- ¥30 截图中的mathematics程序转换成matlab
- ¥15 动力学代码报错,维度不匹配
- ¥15 Power query添加列问题
- ¥50 Kubernetes&Fission&Eleasticsearch
- ¥15 報錯:Person is not mapped,如何解決?
- ¥15 c++头文件不能识别CDialog
- ¥15 Excel发现不可读取的内容
- ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题