题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import sys for line in sys.stdin: a,b = line.split('.') a = int(a) if int(b[0]) >= 5: a += 1 print(a)
原始一点点的解法 文章被收录于专栏
尽量不借助面向对象的思想,自己去实习具体过程
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import sys for line in sys.stdin: a,b = line.split('.') a = int(a) if int(b[0]) >= 5: a += 1 print(a)
尽量不借助面向对象的思想,自己去实习具体过程
相关推荐