Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 178 Bytes

File metadata and controls

15 lines (8 loc) · 178 Bytes

2.不使用第三个变量,交换两个变量的值。

int a = 5;
int b = 10;

a = a + b;   //a=15,b=10;
b = a - b;   //a=15,b=5;
a = a - b;   //a=10,b=5;