print('请输入语文成绩:')
language = input()
language = int(language)
if language < 0 or language > 100:
print('输入有误,请重新输入')
print('请输入数学成绩:')
math = input()
math = int(math)
if math < 0 or math > 100:
print('输入有误,请重新输入')
print('请输入外语成绩:')
english = input()
english = int(english)
if english < 0 or english > 100:
print('输入有误,请重新输入')
# 定义变量avg,用于存储平均成绩
avg = (language + math + english)/3
avg = float(avg)
if avg >= 80:
print('平均分:'+avg+',成绩优良')
elif avg >= 60 and avg < 80:
print('平均分:'+avg+',成绩中等')
elif avg < 60:
print('平均分:'+avg+',平均成绩不及格')