📄 program_6.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 + -