Ellipse circumference by inaniwa

double t,s;main(a,b){for(;~scanf("%d%d",&a,&b);s=!printf("%.f\n",s))for(t=1.57077;t>0;t-=5e-5)s+=hypot(a*sin(t),b*cos(t))/5e3;}

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

download

return to the top page