#include <iomanip>
cout << fixed << setprecision(1) << i; // 精确到小数点后一位
// cout << fixed 等同 cout << setiosflags(ios::fixed)
c++精度输出
最新推荐文章于 2024-07-16 18:31:23 发布
#include <iomanip>
cout << fixed << setprecision(1) << i; // 精确到小数点后一位
// cout << fixed 等同 cout << setiosflags(ios::fixed)