package homework;
/**
-
@ClassName: num.java
-
@Description: TODO(用一句话描述该文件做什么)
-
@author 范海涛
-
@version V1.0
-
@Date 2019-7-24 下午8:51:33
*/
public class num {
public static void main(String[] args) {
//两个数相互交换位置
int x = 3;
int y = 4;
System.out.print(“两个数交换前:x=”+x+";y="+y);x = x+y; //x=3+4 =7
y = x-y; //y=7-4 =3
x = x-y; // x=7-3 =4
System.out.print(“两个数交换后:x= “+x+”;y=”+y);}
}