标签:
#include <iostream> #include <algorithm> #include <iomanip> #include <cmath> #define MAXN 100 using namespace std; double _m[MAXN]; double fun(); int n; int main() { //freopen("acm.acm","r",stdin); int i; cin>>n; for(i = 0; i < n; ++ i) { cin>>_m[i]; } double tem = fun(); for(i = 1; i < n; ++ i) { tem = 2*sqrt(fun()*tem); } cout<<setiosflags(ios::fixed)<<setprecision(3)<<tem<<endl; } double fun() { int i; double max = -1; int index; for(i = 0; i < n; ++ i) { if(_m[i] > max) { max = _m[i]; index = i; } } _m[index] = -1; return max; }
标签:
原文地址:http://www.cnblogs.com/gavinsp/p/4566569.html