with Ada.Text_IO,Ada.Integer_Text_IO;
use Ada.Text_IO,Ada.Integer_Text_IO;
procedure Automatic is
Dog,Cat:Integer;
Pig,Cow:Float;
begin
for Index in 1..10 loop
Put("The value of index is:");
Put(Index,3);
declare
START:constant Integer :=Index;
STOP:constant Integer :=START+5;
Count_Stuff:Integer;
begin
Count_Stuff:=START+STOP+Index+222;
Put("---->");
for Index in START..STOP loop
Put(Index,5);
end loop;
end;
New_Line;
end loop;
end Automatic;
043.Ada语言中的for循环语句
最新推荐文章于 2025-06-14 14:18:22 发布
本文展示了一个使用Ada语言编写的程序示例,该程序利用了Ada.Text_IO和Ada.Integer_Text_IO包来处理文本和整数的输入输出。通过一个名为Automatic的过程,程序演示了如何在循环中使用变量并进行简单的数学运算。
903

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



