Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128496 秦浩然 18患病人数占总患病人数的比例 C++ Wrong Answer 1 MS 272 KB 434 2025-08-17 10:35:20

Tests(1/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,t; int a=0,b=0,c=0,d=0; cin>>n; for(int i=1;i<=n;i++){ cin>>t; if(t>0 && t<=18) a++; else if(t>=19 && t<=35) b++; else if(t>=36 && t<=60) c++; else if(t>=61) d++; } printf("%.2lf%\n",a*100.0/n); printf("%.2lf%\n",b*100.0/n); printf("%.2lf%\n",c*100.0/n); printf("%.2lf%\n",d*100.0/n); return 0; }


Run Info:

------Input------
67 97 57 41 3 39 22 73 44 56 51 56 89 43 19 17 62 84 62 97 95 75 48 84 29 40 70 59 78 12 73 99 35 26 99 21 48 81 5 11 59 50 85 40 21 69 69 88 65 16 24 62 82 2 70 29 63 93 38 92 97 19 41 25 38 91 0 29
------Answer-----
11.94% 17.91% 26.87% 43.28%
------Your output-----
10.45% 17.91% 26.87% 43.28%