首页 > 其他分享 >#include<iomanip>

#include<iomanip>

时间:2022-09-04 20:45:30浏览次数:48  
标签:91.2345 cout setprecision double 保留 include

double a=91.2345;
//setprecision(n) 保留n位有效数组 
//保留小数需要加入 fixed
cout<<setw(4)<<setfill('-')<<1234<<endl;
cout<<setw(4)<<setfill('-')<<2<<endl;
cout<<setw(4)<<setfill('-')<<23<<endl;
cout<<setw(4)<<setfill('-')<<123<<endl;
//setw(n);设置最小宽度
//setfill('');填充字符/数字

标签:91.2345,cout,setprecision,double,保留,include
From: https://www.cnblogs.com/hnzzlxs01/p/16656019.html

相关文章