题干有点问题
及格成绩:60
优秀成绩:85
及格成绩:60
优秀成绩:85
#include <cstdio>
int main(){
int n, x, mi = 0, mx = 0;
scanf("%d", &n);
int total = n;
while(n--){
scanf("%d", &x);
if(x >= 60) mi++;
if(x >= 85) mx++;
}
printf("%d%%\n", (int)(((float)mi / total) * 100 + 0.5));
printf("%d%%\n", (int)(((float)mx / total) * 100 + 0.5));
return 0;
}
0 回复
0 转发
0 喜欢
1 阅读



