C 四舍五入取整(实验二)

来源:互联网 发布:微博有mac版 编辑:程序博客网 时间:2024/05/20 04:27
double a = 123.456;

int b = (int)a;//取整
int c = (int)(a+0.5);//四舍五入
0 0
原创粉丝点击