6 条题解

  • 1
    @ 2025-3-3 13:00:43
    n=int(input())
    i=0;a=0;b=0;c=0;d=0;e=0;f=0;l=[]
    while i<n:
        i+=1
        l.append(input())
    for k in l:
        k=int(k)
        if k<60:
            a+=1
        elif k<70:
            b+=1
        elif k<80:
            c+=1
        elif k<90:
            d+=1
        elif k<100:
            e+=1
        else:
            f+=1
    y=[f,e,d,c,b,a]
    for h in y:
        print(h)
    
  • 0
    @ 2025-3-24 11:43:16

    #include <bits/stdc++.h>

    using namespace std;

    int Hash[11];

    int n, score;

    int main()

    {

    cin>>n;
    
    for(int i=1; i<=n; i++){
    
        cin>>score;
    
        int k=score/10;
    
        if(k<=4) k=5;
    
        Hash[k]=Hash[k]+1;
    
    }
    
    for(int i=10; i>=5; i--){
    
        cout<<Hash[i]<<endl;
    
    }
    
    return 0;
    

    }

    • 0
      @ 2025-3-10 15:49:21

      #include #include #include using namespace std; int n,s; int a[11]; int main() { cin>>n; memset(a,0,sizeof(a)); for(int i=1;i<=n;i++){ cin>>s; int k=s/10; if(k<=5) k=5; a[k]+=1; } for(int i=10;i>=5;i--){ cout<<a[i]<<endl; } return 0; }

      • 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;
        }
        
        • 0
          @ 2025-3-3 12:48:07
          a=int(input())
          b=[]
          c=0
          d=0
          e=0
          f=0
          g=0
          h=0
          for i in range(a):
              b.append(int(input()))
              if b[i]==100:
                  c+=1
              if b[i]>=90 and b[i]<=99:
                  d+=1
              if b[i]>=80 and b[i]<=89:
                  e+=1
              if b[i]>=70 and b[i]<=79:
                  f+=1
              if b[i]>=60 and b[i]<=69:
                  g+=1
              if b[i]<60:
                  h+=1
          print(c)
          print(d)
          print(e)
          print(f)
          print(g)
          print(h)
          
          • -1
            @ 2025-2-24 22:44:10

            Python n = int(input()) score_100 = 0 score_90_99 = 0 score_80_89 = 0 score_70_79 = 0 score_60_69 = 0 score_below_60 = 0 for _ in range(n): score = int(input()) if score == 100: score_100 += 1 elif score >= 90 and score <= 99: score_90_99 += 1 elif score >= 80 and score <= 89: score_80_89 += 1 elif score >= 70 and score <= 79: score_70_79 += 1 elif score >= 60 and score <= 69: score_60_69 += 1 else: score_below_60 += 1 print(score_100) print(score_90_99) print(score_80_89) print(score_70_79) print(score_60_69) print(score_below_60)

            • 1

            信息

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