C++简洁代码:

#include<bits/stdc++.h>
using namespace std;
int main () {
    float f;
    cin >> f;
    cout << int(f + 0.5) << endl;
    return 0;
}