提交时间:2026-03-28 14:55:35
运行 ID: 434389
#include<iostream> #include<iomanip> using namespace std; int main(){ int n,k,a=0,b=0,c=0,d=0; cin>>n; for(int i=1;i<=n;i++){ cin>>k; if(k<=18) a++; else if(k<=35) b++; else if(k<=60) c++; else d++; } cout<<fixed<<setprecision(2)<<a*100.0/n<<"%"<<endl; cout<<fixed<<setprecision(2)<<b*100.0/n<<"%"<<endl; cout<<fixed<<setprecision(2)<<c*100.0/n<<"%"<<endl; cout<<fixed<<setprecision(2)<<d*100.0/n<<"%"<<endl; return 0; }