题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include <iostream> using namespace std; int main() { float a; int b; while (cin >> a) { // 注意 while 处理多个 case b = (a-int(a))<0.5? a : a+1; cout << b << endl; } return 0; } // 64 位输出请用 printf("%lld")