题解 | 取近似值
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
x = str(input()) x1 = int(x.split('.')[0]) x2 = ('0'+'.'+str(x.split('.')[-1])) if len(x.split('.')[-1]) <= 5: if float(x2) >= 0.5: x = x1 + 1 print(x) else: print(x1)