11 条题解

  • 0
    @ 2026-4-12 19:23:44

    #include #include using namespace std; int main() { int n,tmp,a1=0,a2=0,a3=0,a4=0; cin>>n; for(int i=0;i<n;i++) { cin>>tmp; if(tmp<=18)a1+=1; else if(19<=tmp&&tmp<=35)a2+=1; else if(36<=tmp&&tmp<=60)a3+=1; else if(tmp>=61)a4+=1; } cout<<fixed<<setprecision(2); cout<<a1100.0/n<<'%'<<endl; cout<<a2100.0/n<<'%'<<endl; cout<<a3100.0/n<<'%'<<endl; cout<<a4100.0/n<<'%'<<endl; return 0; }

    信息

    ID
    1006
    时间
    1000ms
    内存
    128MiB
    难度
    5
    标签
    递交数
    627
    已通过
    239
    上传者