题解 | 取近似值
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import sys n = 5 x = input() try: x1,x2 = map(int,x.split('.')) x3 = str(x2) + "0"*(n-len(str(x2))) if int(x3) < 50000: x1 = x1 else: x1 += 1 except: x1 = x print(x1)