好像有点问题 7-8行写错了
s = 0
n = 0
c = 0
while True:
a = int(input())
if a < 0:
if s == 0:
print("没有学生")
exit()
else:
print("平均分=" + str(round(n / s, 2)) + ",不及格人数=" + str(c))
exit()
else:
if a < 60:
s += 1
c += 1
n += a
else:
s += 1
n += a
亲测可用
不行的话把第11行的 ",不及格人数=" 里的逗号改成中文逗号