a=40; b=30; c=10;
d=a^2-b^2;f=2*c^2*d*sqrt(d^2/27+c^4);
g=d^3/27+2*c^4*d;h=d/3+(g+f)^(1/3)+(g-f)^(1/3);
j=sqrt(c^2-d+h);k=sqrt((2*c*d+2*c^3)/j+2*c^2-d-h);
m=(c+j+k)/2;sqrt(b^2-m^2)

I had this riddle to solve and I know the answer to be
around ~ 12.31185723778668829963


What steps can i go about to get this to compute this problem without doing the work for this problem and other problems similar to this?
I'm not used to c++ and just need help with initialization and outputting the answer I got.


Its based off the very old riddle if anyone cares :

http://en.wikipedia.org/wiki/Crossed_ladders_problem