package com.Test;
public class Test {
public static void main(String[] args){
int x = 1;
int y = 2;
int temp; //交换媒介
System.out.println("x:"+x+" y:"+y);
//交换x和y的值
temp = x;
x = y;
y = temp;
System.out.println("x:"+x+" y:"+y);
}
}
交换两个数的值
最新推荐文章于 2021-06-22 17:06:40 发布
1218

被折叠的 条评论
为什么被折叠?



