c++输出保留固定小数位数

cout<<setprecision(6)<<fixed<<ans<<endl;

原文地址:https://www.cnblogs.com/wuxiangli/p/6366565.html