Ellipse circumference by notogawa

float x,a,b;main(n){for(;~scanf("%f%f",&a,&b);printf("%.f\n",x))for(n=4e3;--n;)x=a*6.2832+(n-2+.75/n)/n*(1-b*b/a/a)*x;}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page