头文件:
#include <iomanip>//也可以写#include "iomanip"
简易写法:
cout<<数<<setprecision(需要保留的位数);
c++保留几位小数
原文:https://www.cnblogs.com/Uiney117/p/14427826.html