题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include <iostream> using namespace std; int main() { float num; while (cin >> num) { int num_int = (int)num; if (num - num_int >= 0.5){ cout << num_int + 1 << endl; } else cout << num_int << endl; } return 0; }#23届找工作求助阵地##C++##零基础学习C++#