swap.adb.npp

来自「This contains the following topics and m」· NPP 代码 · 共 24 行

NPP
24
字号
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 + =
减小字号Ctrl + -
显示快捷键?