程式碼檢視器 – 2-1-score-average-if-else-print.py

← 返回清單
# -*- coding: utf-8 -*-

print("請依序輸入三科成績:國文、英文、數學")

score_a = int(input("國文成績:"))
score_b = int(input("英文成績:"))
score_c = int(input("數學成績:"))

total = score_a + score_b + score_c
average = total / 3.0

print("\n三科總分:", total)
print("平均分數:", round(average, 2))

if average >= 80:
    print("恭喜!平均分數達到標準,表現很優秀!")
else:
    print("加油!尚未達到標準,下次一定可以更好!")