求关
2026-07-31 20:38:14
发布于:广东
27阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int one = 0;
int two = 0;
int three = 0;
int four = 0;
for(int i = 1;i <= n;i++){
int x;
cin >> x;
if(x <= 18){
one++;
}
else if(x <= 35){
two++;
}
else if(x <= 60){
three++;
}
else{
four++;
}
}
double g = one1.0 / n;
printf("%.2f" , g100);
cout << "%" << endl;
double h = two1.0 / n;
printf("%.2f" , h100);
cout << "%" << endl;
double l = three1.0 / n;
printf("%.2f" , l100);
cout << "%" << endl;
double o = four1.0 / n;
printf("%.2f" , o100);
cout << "%" << endl;
return 0;
}
这里空空如也







有帮助,赞一个