题解 | 取近似值
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include <iostream>
int main(){
int i;
float x, r;
std::cin >> x;
i = int(x);
r = x - i;
if(r >= 0.5){
std::cout << i+1 << std::endl;
}else{
std::cout << i << std::endl;
}
return 0;
}

