with Ada.Text_IO;
use Ada.Text_IO;
procedure Compare is
package Enum_IO is new Ada.Text_IO.Enumeration_IO(BOOLEAN);
use Enum_IO; -- here is equal to rename
One :Integer :=1;
Two :Integer :=2;
Three :Integer :=3;
Is_It : Boolean :=True; --initialized
Which :Boolean; --uninitialized
begin
Which :=True;
Put(" Which now has the value of ");
Put(Which);
New_Line;
Which:=False;
Put("which now has the value of ");
Put(Which);
New_Line;
Is_It :=(One+1)=Two;
Is_It :=One/=Two;
Is_It :=One+Two>=Three;
end Compare;
012:Ada语言中的boolean类型
最新推荐文章于 2025-06-09 14:39:50 发布
本文展示了Ada编程语言中布尔运算的使用及枚举类型的输入输出操作。通过具体示例,演示了变量初始化、赋值以及比较运算的过程。深入理解Ada语言的这一特性对于掌握其编程技巧至关重要。
1442

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



