如何在c++中输出一个10位小数

2025-03-11 14:17:47
推荐回答(1个)
回答1:

包含头文件
#include

用setprecision(n)设置精度,其中n表示精确到小数点后n位
例子:
double
t
=
3.33333333;
cout<输出就是8位精度小数