保留小数点的方法2种

//1
cout<<fixed<<setprecision(n)<<a;//n为保留的小数位数,a为要保留的数。
//2
 printf("%.nf",a)//同上。

2 条评论

  • 1