Cancel fractions by murky-satyr

let rec f n d=print_int(n/(n+d));n+d<d&()=Printf.printf"/%d"(d/(n+d));print_newline()and(!)_=Scanf.scanf"%d/%d "f;!0and(+)a b=try b mod a+a with _->b;;!0

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

download

return to the top page