Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
6235 | 陶俊宸 | 年龄与疾病 | C++ | 通过 | 100 | 0 MS | 252 KB | 318 | 2020-09-19 21:36:58 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,o; double a=0,b=0,c=0,d=0; cin>>n; for(int i=0;i<n;i++){ cin>>o; if(o<=18) a++; else if(o<=35) b++; else if(o<=60) c++; else d++; } printf("%.2lf%%\n%.2lf%%\n%.2lf%%\n%.2lf%%",a/n*100,b/n*100,c/n*100,d/n*100); return 0; }