- englishscore=int(input("請輸入英文成績:"))
- chinesescore=int(input("請輸入國文成績:"))
- mathscore=int(input("請輸入數學成績:"))
- totalscore=englishscore+chinesescore+mathscore
- print("總分:",totalscore)
- totalscore=totalscore/3
- print("平均分數為%.2f"%totalscore)
- if totalscore>=60:
- print("及格!!")
- else:
- print("不及格!!")
複製代碼 |