def calculate_score(score1, score2, score3): total_score = score1 + score2 + score3 average_score = total_score / 3 print("成绩总和:", total_score) print("平均成绩:", round(average_score, 1))

score1 = int(input()) score2 = int(input()) score3 = int(input())

calculate_score(score1, score2, score3)

输入三门课成绩编写函数计算三门课程总分和平均值。用例:输入:959878输出:成绩总和: 271平均成绩: 903

原文地址: https://www.cveoy.top/t/topic/faDR 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录