Reduce fractions FIXED by hallvabo

while 1:
 a,b=n,d=map(int,raw_input().split('/'))
 while b:a,b=b,a%b
 print`n/a`+'/'+`d/a`

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

download

return to the top page