Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
239 B
1
Indexable
Never
#include <iostream>
#include <math.h>

int main() {
    
    float g;
    std::cin >> g;

    if (g - int(g) >= 0.5) {
        std::cout << g + (1-(g - int(g)));
    }
    else {
        std::cout << g - (g - int(g));
    }
}
Leave a Comment