Swap The Characters by rolf

while 1:
 s=raw_input().split();t=s[0]
 for a,b in s[1:]:t=t.replace(a," ").replace(b,a).replace(" ",b)
 print t

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

download

return to the top page