import java.util.Scanner;

public class Main {

public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    //write your code here.......
    a=a+b;
    b=a-b;
    a=a-b;

    System.out.println(a+" "+b);
}

}

我们先让a=1,b=2,因为代码是自上而下运行,且我们不能引入第三个变量,所以要从ab两个变量下手,先让a=a+b的和即为3,此时交换数值,b还是等于2,b要等于1,b=a-b,此时b=1,a要等于2,此时a=3,所以a=a-b