Egyptian fraction by pooq

File standardInput readLines map($,write($);s:=" =";$split("/")map(asNumber)reduce(a,b,while(a>0,c:=(b/a)ceil;a=c*a-b;b=c*b;write(s," 1/",c);s=" +"))writeln)

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

download

return to the top page