Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
434389 admin_rjp 【C2-9】年龄与疾病 C++ 通过 100 3 MS 252 KB 481 2026-03-28 14:55:35

Tests(1/1):


#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; }


测评信息: