std::round 函数,它属于 <cmath> 头文件,专门用于四舍五入操作。
std::round
<cmath>
注意: 当小数部分为 0.5 时,向远离零的方向舍入(例如,-2.5 会变为 -3)。