| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 61088 | 余慕涵 | 18患病人数占总患病人数的比例 | C++ | Wrong Answer | 1 MS | 272 KB | 613 | 2023-12-01 20:07:21 |
#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main(){ double l=0,m=0,f=0,h=0; int r,o,n; cin>>o; int a[o]; for(r=0;r<o;r++) cin>>a[r]; for(r=0;r<o;r++){ if(a[r]>=0 && a[r]<=18) l++; if(a[r]>=19 && a[r]<=35) m++; if(a[r]>=36 && a[r]<=60) h++; if(a[r]>=61) f++; } printf("%2.lf%%\n",l*1.0/o*100); printf("%2.lf%%\n",m*1.0/o*100); printf("%2.lf%%\n",h*1.0/o*100); printf("%2.lf%%\n",f*1.0/o*100); return 0; }
------Input------
14 49 93 26 7 7 90 95 66 43 17 89 75 35 86
------Answer-----
21.43% 14.29% 14.29% 50.00%
------Your output-----
21% 14% 14% 50%