C语言四舍五入保留两位小数的程序怎么写?
C语言四舍五入保留两位小数的程序怎么写?
日期:2019-08-19 12:04:34 人气:2
#include
double fun ( float h )
{ return (long)( h * 100 + 0.5 )/ 100.0;}main( ){
float a;printf ("Enter a: "); scanf ( "%f", &a );printf ( "The original data is : " );printf ( "%f \n\n", a )