不用第三个变量,交换两个数
public void swap(int a, int b) { a = a + b; b = a - b; a = a - b; System.out.println("a="+a); System.out.println("b="+b);}