Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
230 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
    float a;
    float b;
    cin >> a;

    b = a - (int)a;

    if (b >= 0.5) {
        cout << (int)a + 1;
    }
    else {
        cout << int(a);
    }
}
Leave a Comment