Reduce fractions FIXED by tttaki

m@main=getLine>>=putStrLn.g.map read.words.f>>m
f('/':s)=' ':s
f(x:s)=x:f s
a%b=show$div a$gcd a b
g[a,b]=a%b++'/':b%a

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

download

return to the top page