1、普通的printf输出打印
printf()函数的用例
float date=123.456;
printf("date=%.2f\n", date);//保留2位
printf("date=%.1f\n", date);//保留1位
输出

2、获取四舍五入后的数据
1、使用round函数
C ++ round()函数 (C++ round() function)
round() function is a library function of cmath header, it is used to round the given value that is nearest to the number with halfway cases rounded away from zero, it accepts a number and returns rounded value.
round()函数是cmath标头的











![[附源码]java毕业设计文章管理系统查重PPT](https://img-blog.csdnimg.cn/5d775b6c9e2942d98ddaeab3c186831d.png)

![[附源码]java毕业设计小区物业管理系统论文](https://img-blog.csdnimg.cn/eb647dea0ed842edbf9db194c44bdb75.png)





