题解 | #取近似值#
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
笨办法
str1 = float(str)
str2 = int(str1)
if (str1-str2)>=0.5:
print(str2+1)
else:
print(str2)
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
笨办法
str1 = float(str)
str2 = int(str1)
if (str1-str2)>=0.5:
print(str2+1)
else:
print(str2)
相关推荐