with Ada.Text_IO;
use Ada.Text_IO;
procedure IncrInt is
Index : Integer;
begin
Index:=13;
Index:=Integer'Pos(Index); -- Still 13
Index:=Integer'Val(Index); -- Still 13
Index:=Integer'Succ(Index); -- Incremented to 14
Index:=Integer'Pred(Index); -- Decremented to 12
Index:=Index+1;-- preferred method of incrementing
end IncrInt;
023.Ada语言的整数类型中的不是很有用的属性
最新推荐文章于 2024-07-03 17:12:27 发布