python3题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
n=float(input()) a=n-int(n) if a<0.5: print(int(n)) else: print(int(n)+1) ''' num=float(input()) val=round(num) # round() 四舍五入 if num-val==0.5: # 等于0.5时,需舍 不能入 val=val+1 print(val) '''