printf()函数的用例
- float date=123.456;
- printf("date=%.2f\n", date);//保留2位
- printf("date=%.1f\n", date);//保留1位
输出
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标头的