#include <iostream> #include <iomanip> using namespace std; int main () { double f =3.14159; cout << setprecision (5) << f << endl; cout << setprecision (9) << f << endl; cout << fixed; cout << setprecision (5) << f << endl; cout << setprecision (9) << f << endl; return 0; }
cout设置输出精度

最新推荐文章于 2025-05-29 15:33:29 发布
