#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <cmath>using namespace std;#define maxn 55int n;int f[maxn];int gcd(int a, int b){ if (b > 0) return gcd(b, a % b); return a;}void input(){ for (int i = 0; i < n; i++) scanf("%d", &f[i]);}void work(){ int numerator = 0; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) if (gcd(f[i], f[j]) == 1) numerator++; if (numerator == 0) { printf("No estimate for this data set.n"); return; } printf("%.6fn", sqrt(n * (n - 1) * 3.0 / numerator));}int main(){ while (scanf("%d", &n), n) { input(); work(); } return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)