Swap The Characters by empitax

import java.util.*;enum A{A;System S;String t;char c,d,e;{for(Scanner s=new Scanner(S.in);(t=s.next())==t;S.out.println(t))for(String p:s.nextLine().trim().split(" "))t=t.replace(c=p.charAt(0),e).replace(d=p.charAt(1),c).replace(e,d);}}

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

download

return to the top page