| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 61090 | 余慕涵 | 18患病人数占总患病人数的比例 | C++ | Wrong Answer | 1 MS | 272 KB | 609 | 2023-12-01 20:09:43 |
#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++; else if(a[r]>=19 && a[r]<=35) m++; else if(a[r]>=36 && a[r]<=60) h++; else if(a[r]>=61) f++; } printf("%2.lf%%\n",l/o*100); printf("%2.lf%%\n",m/o*100); printf("%2.lf%%\n",h/o*100); printf("%2.lf%%\n",f/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%