设置浮点数精度 setprecision
求平均 #include #include using namespace std;int main () { int n; cin>>n; int age; double sum = 0.00; for(int i = 0; i < n; i++) { cin>>age; sum += age; } sum /= n; cout<<fixed<<setpreci