题解 | #实现四舍五入#
实现四舍五入
https://www.nowcoder.com/practice/020a0cf673174d5795d97ae79cff59a0
#include <iostream> using namespace std; int main() { double d; cin>>d; if(d > 0) { d +=0.5; int num = d/1; cout<<num; } else { d -=0.5; int num = d/1; cout<<num; } } // 64 位输出请用 printf("%lld")