题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import sys #for line in sys.stdin: # a = line.split() # print(int(a[0]) + int(a[1])) s = input() list1 = s.split(".") #print(list1) #为了防止说float的小数位数太多,取小数位数的第一位就行了list1[1][0]) if int(list1[1][0])>=5: # print(list1[1]) res=str(int(list1[0])+1) list1[0]=res # print(list1[0]) else: pass print(list1[0])