题解 | 取近似值
import math //注意不能用round,因为这个是银行家舍入法,即“四舍六入五取偶” def flour0ut_fivein(n): //向上取整 n_min = math.floor(n) //向下取整 n_max = math.ceil(n) //判断 if n-n_min >=0.5: n = n_max else: n = n_min return n //主要要将输入的值转换为浮点型 n = float(input().strip()) print(flour0ut_fivein(n))