6 条题解
-
0
#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
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
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
- 上传者