Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152087 万麟峰 18患病人数占总患病人数的比例 C++ Wrong Answer 1 MS 272 KB 480 2026-04-19 15:30:43

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n+1]; for(int i=1;i<=n;i++){ cin>>a[i]; } double s=100/n; double d=0,f=0,g=0,h=0; for(int i=1;i<=n;i++){ if(a[i]>=0 && a[i]<=18){ d++; } if(a[i]>=19 && a[i]<=35){ f++; } if(a[i]>=36 && a[i]<=60){ g++; } if(a[i]>=61){ h++; } } printf("%.2lf\n",d*s); printf("%.2lf\n",f*s); printf("%.2lf\n",g*s); printf("%.2lf",h*s); return 0; }


Run Info:

------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.00 14.00 14.00 49.00