cout 保留小数位

如果要输出 x 位的变量 output .

cout << fixed << setprecision(x) << output << endl;

setprecision头文件是 <iomanip> .

posted @ 2022-07-20 21:34  聂天泽  阅读(62)  评论(0编辑  收藏  举报