题解 | #按照格式输入并交换输出#
按照格式输入并交换输出
http://www.nowcoder.com/practice/95eb723a3e854376a7eb6d116cc7d875
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.nextLine();
String[] strs = str.split(",");
int a = Integer.parseInt(strs[0].substring(2));
int b = Integer.parseInt(strs[1].substring(2));
a = a ^ b;
b = a ^ b;
a = a ^ b;
System.out.println(strs[0].substring(0,1) +"="+ a+","+strs[1].substring(0,1) +"="+ b);
}
}