import random
def fuc(a, b):
num = []
for i in range(20):
num.append(random.randint(a, b))
num.sort()
A = []
B = []
C = []
for j in num:
if 90 < j <= 100:
A.append(j)
elif 80 < j <= 90:
B.append(j)
else:
C.append(j)
return f'二十位学生成绩为{num};\n其中等级A学生{len(A)}位,等级B{len(B)}位,等级C{len(C)}位'
print(fuc(0, 100))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)