题解 | #取近似值#python3
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
做这题是第一次发现round()的局限性
import math
while True:
try:
num1 = float(input())
num2 = (math.floor(num1*10) % 10)
if(num2 >= 5):
print(math.ceil(num1))
else:
print(math.floor(num1))
except:
break