| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 152406 | 刘杨国卿 | 18患病人数占总患病人数的比例 | C++ | Wrong Answer | 1 MS | 272 KB | 546 | 2026-04-26 09:17:49 |
#include<bits/stdc++.h> using namespace std; int main(){ double n,a[101],b=0,c=0,d=0,e=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ if(a[i]>=0 and a[i]<=18){ b++; }else if(a[i]>=19 and a[i]<=35){ c++; }else if(a[i]>=36 and a[i]<=60){ d++; }else if(a[i]>=61 and a[i]>=61){ e++; } } printf("%.2f",b*10.00); cout<<"%"<<" "; printf("%.2f",c*10.00); cout<<"%"<<" "; printf("%.2f",d*10.00); cout<<"%"<<" "; printf("%.2f",e*10.00); cout<<"%"<<" "; 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-----
30.00% 20.00% 20.00% 70.00%