#include<iostream>
#include<cmath>
#include<iomanip>
#define MAXN 50
using namespace std; int _m[MAXN];
int gcd(int a,int b);
int main()
{
//freopen("acm.acm","r",stdin);
int n;
int i;
int j;
double sum_all;
double sum;
while(cin>>n,n)
{
sum = ;
sum_all = ;
for(i = ; i < n; ++ i)
{
cin>>_m[i];
}
for(i = ; i < n; ++ i)
{
for(j = i+; j < n; ++ j)
{
if(gcd(_m[i],_m[j]) == )
{
++ sum;
}
++ sum_all;
}
}
if(sum == )
{
cout<<"No estimate for this data set."<<endl;
continue;
} cout<<setiosflags(ios::fixed)<<setprecision()<<sqrt(((sum_all*6.0)/sum))<<endl;
} } int gcd(int a,int b)
{
if(b == )
return a;
return gcd(b,a%b);
}
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。
技术网站地址: vmfor.com