跳转至内容

Ada 编程/关键字/reverse

来自 Wikibooks,开放书籍,开放世界

Ada. Time-tested, safe and secure.
Ada.经时间考验,安全可靠。

此关键字用于 for 循环 中,以指定循环以相反顺序执行

  for I in reverse 1 .. 10 loop
     Ada.Integer_Text_IO.Put (I);
     Ada.Text_IO.New_Line;
  end loop;

输出

        10
         9
         8
         7
         6
         5
         4
         3
         2
         1

另请参阅

[编辑 | 编辑源代码]

Ada 参考手册

[编辑 | 编辑源代码]

Ada 质量和风格指南

[编辑 | 编辑源代码]


Ada 关键字
abort else new return
abs elsif not reverse
abstract (Ada 95) end null
accept entry select
access exception of separate
aliased (Ada 95) exit or some (Ada 2012)
all others subtype
and for out synchronized (Ada 2005)
array function overriding (Ada 2005)
at tagged (Ada 95)
generic package task
begin goto parallel (Ada 2022) terminate
body pragma then
if private type
case in procedure
constant interface (Ada 2005) protected (Ada 95) until (Ada 95)
is use
declare raise
delay limited range when
delta loop record while
digits rem with
do mod renames
requeue (Ada 95) xor
华夏公益教科书