c++怎么保留小数位数 超级摆烂王 2022-03-30 286 阅读1分钟 #include //保留小数点后n位 cout << setiosflags(ios::fixed) << setprecision(n) //保留n位有效数字 cout << setprecision(n)