fixed<<setprecision(n)

来源:互联网 发布:海量数据与数据港谁好 编辑:程序博客网 时间:2024/05/16 03:33
#include<iomanip>cout<<fixed<<setprecision(n)<<num<<endl;

控制浮点数num小数点后输出n位数。

某些变态的题会要求用这种方法输出浮点数!!

0 0
原创粉丝点击