精度确定

cout<<fixed<<setprecision(2)<<average<<endl;

fixed不能少

原文地址:https://www.cnblogs.com/xinsheng/p/1998012.html