package C; public class Bisai { public static void main(String[] args) { String a="xyz",b="",c=""; for (int i = 0; i < 3; i++) { if(a.substring(i,i+1).equals("x")||a.substring(i,i+1).equals("z")) { continue; } System.out.println("c VS "+a.substring(i,i+1)); b=a.replace(a.substring(i,i+1), ""); } for (int i = 0; i < 2; i++) { if(b.substring(i,i+1).equals("x")) { continue; } System.out.println("a VS "+b.substring(i,i+1)); c=b.replace(b.substring(i,i+1), ""); } System.out.println("b VS "+c); } }