6 条题解

  • 0
    @ 2025-3-4 14:52:34
    #include <bits/stdc++.h>
    
    using namespace std;
    
    int main() { int a[40],n,m =0,b=0,c=0,d=0,e=0,f=0;
    
    cin>>n;
    
    for (int i = 0; i <= n-1; i++) {
        cin>>a[i];
        if(a[i]==100)
        {
            m=m+1;
        }
        if(90<=a[i] and a[i]<100)
        {
            b=b+1;
        }if(80<=a[i] and a[i]<90)
        {
            c=c+1;
        }if(70<=a[i] and a[i]<80)
        {
            d=d+1;
        }if(60<=a[i] and a[i]<70)
        {
            e=e+1;
        }if(a[i]<60)
        {
            f=f+1;
        }
    }
    cout<<m<<endl;
    cout<<b<<endl;
    cout<<c<<endl;
    cout<<d<<endl;
    cout<<e<<endl;
    cout<<f<<endl;
    return 0;
    }
    

    信息

    ID
    39
    时间
    1000ms
    内存
    128MiB
    难度
    4
    标签
    递交数
    901
    已通过
    407
    上传者