| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 162448 | 鸡哥 | 18患病人数占总患病人数的比例 | C++ | Accepted | 12 MS | 272 KB | 387 | 2026-10-17 15:20:31 |
#include<bits/stdc++.h> using namespace std; int main(){ int a[105],m=0,x=0,s=0,z=0,j; cin>>j; for(int i=1;i<=j;i++){ cin>>a[i]; } for(int i=1;i<=j;i++){ if(a[i] <= 18)m++; else if(a[i] <= 35)x++; else if(a[i] <= 60)s++; else if(a[i] >= 61)z++; } printf("%.2f%%\n%.2lf%%\n%.2f%%\n%.2f%%",m*1.0/j*100,x*1.0/j*100,s*1.0/j*100,z*1.0/j*100); return 0; }