C++保留指定位数 #include<iomanip> int value = 12.3456789 cout << setprecision(4) << value << endl; // 这里的精度为输出位数,所以输出为12.34 cout<<fixed<<setprecision