public class SwapNum {
public static void main(String[] args) {
doSwapNum();
}
public static void doSwapNum(){
//利用加减法
int a = 10, b = 5;
a = a + b;
b = a – b;
a = a – b;
System.out.println("a=" + a + "\nb=" + b);
}
}

05-04 11:01