| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 151938 | 王安安 | 18患病人数占总患病人数的比例 | C++ | Wrong Answer | 1 MS | 272 KB | 490 | 2026-04-19 12:23:55 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,d=0,b=0,c=0,t=0; cin>>n; int a[n]; for(int i=0;i<10;i++){ cin>>a[i]; } for(int i=0;i<10;i++){ if(0<a[i] and a[i]>18){ d++; } if(19<a[i] and a[i]>35){ b++; } if(36<a[i] and a[i]>60){ c++; } if(61<a[i]){ t++; } } cout<<d/100.0*100<<"%"<<endl; cout<<b/100.0*100<<"%"<<endl; cout<<c/100.0*100<<"%"<<endl; cout<<t/100.0*100<<"%"<<endl; 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-----
7% 6% 4% 4%