题解 | #按照格式输入并交换输出#
按照格式输入并交换输出
http://www.nowcoder.com/practice/95eb723a3e854376a7eb6d116cc7d875
import java.util.Scanner;
import java.util.regex.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String src = sc.nextLine();
Matcher matcher = Pattern.compile("-?\\d+").matcher(src);
matcher.find();
int first = Integer.parseInt(matcher.group());
matcher.find();
int second = Integer.parseInt(matcher.group());
first = first ^ second;
second = first ^ second;
first = first ^ second;
sc.close();
System.out.print("a=" + first + ",b=" + second);
}
}