cout 保留小数位

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

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

setprecision头文件是 <iomanip> .

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