📄 swap.adb
字号:
with Ada.Text_IO, Ada.Integer_Text_IO;-- Ada.Swap;
use Ada.Text_IO, Ada.Integer_Text_IO;
procedure Main is
Books_Room_1 : Integer;
Books_Room_2 : Integer;
procedure swap (First : in out Integer; Second : in out Integer) is
Temp : Integer;
begin
Temp := First;
First := Second;
Second := Temp;
end swap;
begin
Books_Room_1 := 10;
Books_Room_2 := 20;
Put ("Books in room 1 =");
Put (Books_Room_1);
New_Line;
Put ("Books in room 2 =");
Put (Books_Room_2);
New_Line;
Put ("Swap around");
New_Line;
swap (Books_Room_1, Books_Room_2);
Put ("Books in room 1 =");
Put (Books_Room_1);
New_Line;
Put ("Books in room 2 =");
Put (Books_Room_2);
New_Line;
end Main;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -