fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. double wi(int i, double a)
  5. {
  6. return i*sqrt(pow(i,2) - pow(a,2));
  7. }
  8. int main() {
  9. int N= 10;
  10. double Wavgeom = 1;
  11. for (int i=1; i<=N; ++i)
  12. Wavgeom *= wi(i, 0.5);
  13. Wavgeom = pow(Wavgeom, pow(N, -1));
  14. std::cout << Wavgeom;
  15. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
20.0754