a = int(input())
b = list(map(int, input().split()))
ans = sum(b)
c = ans / a
formatted_c = "{:.2f}".format(c)
if formatted_c[-1] == "0":
print(float(c * 10))
說實話,大多語言沒有內建到第幾位的四捨五入
你要實踐的話就是取三位小數點(乘1000再取餘)
再對那個整數做條列判斷
我的作法是先把答案格式化 f'{ans:.2f}'
然後再對結果 rstrip 多餘的0