题解 | #取近似值#
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
python3解题(不调用第三方库函数):HJ7 取近似值
num = float(input())
# print((round(num)))#注意round有小坑,并不一定都是四舍五入
a,b = divmod(num,1)
a = int(a)
if b>=0.5:
print(a+1)
else:
print(a)