#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设置输出精度
最新推荐文章于 2023-12-30 23:47:00 发布