with Ada.Text_IO;
use Ada.Text_IO;
procedure ArrayOps is
type ARY_INT is array(1..6) of Integer;
type ARY_BOOL is array(4..7) of Boolean;
Do_They_Compare:Boolean;
Crowd,Group1,Group2:ARY_INT;
Result,Answer1,Answer2:ARY_BOOL;
begin
Group1:=(12,17,-1,3,-100,5);
Group2:=(13,-2,22,1,1242,-12);
Do_They_Compare:=Group1<=Group2;
Do_They_Compare:=Group1>Group2;
if Group1=Group2 then
Put("The arrays are equal.");
New_Line;
end if;
Answer1:=(TRUE,FALSE,TRUE,FALSE);
Answer2:=(TRUE,FALSE,FALSE,TRUE);
Result:=Answer1 and Answer2;
Result:=not Answer2;
Result:=Answer2 or Answer1;
Result:=Answer1 xor Answer2;
if Answer1/=Answer2 then
Put("The boolean arrays are not equal");
New_Line;
end if;
end ArrayOps;
094.可作用于数组中的运算符
最新推荐文章于 2023-11-13 16:22:40 发布