Python题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import sys
n = float(input())
a = int(n)
b = n - a
if b < 0.5:
print(a)
elif b >= 0.5:
print(a + 1)
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import sys
n = float(input())
a = int(n)
b = n - a
if b < 0.5:
print(a)
elif b >= 0.5:
print(a + 1)
相关推荐