Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
82112 sh25_chenyj 年龄与疾病 C++ Accepted 0 MS 252 KB 433 2026-01-10 12:36:41

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int ls[4]= {0, 0, 0, 0}; for(int i = 0; i < n; i++){ int a; cin>>a; if(a <= 18){ ls[0] ++; } else if(a <= 35){ ls[1] ++; } else if(a <= 60){ ls[2] ++; } else if(a >= 61){ ls[3] ++; } } for(int i = 0; i<4; i++){ cout << fixed << setprecision(2)<<ls[i]*1.0/n*100<<"%"<<endl; } return 0; }


Judgement Protocol: