fork download
  1. #include<iostream>
  2. using namespace std;
  3. #include<cstdlib>
  4. #include<cmath>
  5. #include<math.h>
  6. using std::sin;
  7. using std::cos;
  8. #include<iostream>
  9. using namespace std;
  10. #include<cstdlib>
  11. #include<cmath>
  12. #include<math.h>
  13. using std::sin;
  14. using std::cos;
  15.  
  16. /*
  17. double numer(double n,double x)
  18. {
  19.  
  20.   return pow(-1,n)*pow(x,xponent);
  21. }
  22.  
  23. double denom(double n, double(*f)(double))
  24. {return f(n)*(3*n+1);}
  25.  
  26.  
  27. */
  28.  
  29. double factorial(double n)
  30. {
  31. int prod =1;
  32. for(int b=n; n>0; --n)
  33. {prod*=n;}
  34. cout << prod;
  35. }
  36.  
  37. int xponent(int n)
  38. {
  39. return 2*n+1;
  40. }
  41. int main()
  42. {
  43. long NMAX=1000;
  44. double sum=0;
  45. for(int n=0;n<1000; n++)
  46. {
  47.  
  48. sum += (pow(-1,n)*pow(0.3,xponent(n))/(factorial(n)*(3*n+1);
  49. }
  50. cout << (2/sqrt(M_PI))*sum;
  51. }
  52.  
Success #stdin #stdout #stderr 0.14s 46240KB
stdin
Syms x y
f=1
ax=0
bx=2
ay=0
by=(sqrt(4-x^2))^3/2
area=4×((int(int(f,y,ay,by),x,ax,bx)))
stdout
Standard output is empty
stderr
parse error near line 16 of file /home/z7cIAD/prog.octave

  syntax error

>>> /*
    ^

error: source: error sourcing file '/home/z7cIAD/prog.octave'