⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swap3.txt

📁 java的一经典教程
💻 TXT
字号:
public class Swap3
{
  public static void main(String[] args)
   {
		// declare and initialise variables

		int a1 = 7;
		int a2 = 9;
		int a3 = 13;

		// Write out initial values

		System.out.println("Before the swap...");
		System.out.println("a1 has value " + a1);
		System.out.println("a2 has value " + a2);
		System.out.println("a3 has value " + a3);

		// swap values

		int temp;
		// temporary variable to facilitate the swap

		temp = a3;
		a3 = a2;
		a2 = a1;
		a1 = temp;

		// Write out new values

		System.out.println("After the swap...");
		System.out.println("a1 has value " + a1);
		System.out.println("a2 has value " + a2);
		System.out.println("a3 has value " + a3);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -