⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program_6.adb

📁 This contains the following topics and more ADA versus C and Cplus plus Ada_training ADA 2005 for
💻 ADB
字号:
with Ada.Text_IO;         use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

procedure Age is

   Age : Integer range 0 .. 100;

begin
   Put ("hello, how old are you ? ");
   Get (Age); -- might cause an exception if value entered is outside range

   if Age < 18 then

      Put_Line ("ha! you're just a baby");

   elsif Age <= 10#6_0# then -- note spelling of elsif
      Put_Line ("working hard?");
   else
      Put_Line ("Now take it easy old fella!");
   end if;
exception
   when Constraint_Error =>
      Put_Line ("sorry only ages 0..100 are accepted");
end Age; -- procedure name is optional at end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -