最佳答案
我有一个 float
值的列表,我想用小数点后2位的 cout
打印它们。
例如:
10.900 should be printed as 10.90
1.000 should be printed as 1.00
122.345 should be printed as 122.34
我怎么能这么做?
(setprecision
似乎对此没有帮助。)