| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 46421 | 杨中琦 | 年龄与疾病 | C++ | Accepted | 100 | 0 MS | 256 KB | 397 | 2022-07-13 13:10:11 |
#include <iostream> #include <iomanip> using namespace std; int main() { int n, age, a[4]={0}; cin >> n; for (int i=0; i<n; i++){ cin >> age; if (age <= 18) a[0]++; else if (age>18 && age<36) a[1]++; else if (age>35 && age<61) a[2]++; else a[3]++; } for (int i=0; i<4; i++){ cout << fixed << setprecision(2) << (double)a[i]/n*100 << "%" << endl; } return 0; }