python,80分

B2016 浮点数向零舍入

EC75 @ 2021-12-04 16:32:51

a=float(input())
print(round(a))

by little_cindy @ 2021-12-04 16:35:13

@continue_and_break

正数向下舍入,负数向上舍入。


by little_cindy @ 2021-12-04 16:40:07

强制转化刚好自带这种功能

a=float(input())
print(int(a))

by little_cindy @ 2021-12-04 16:40:18

@continue_and_break


by EC75 @ 2021-12-04 16:45:08

@little_cindy 谢谢咯!^_^


|