📄 if_program.adb
字号:
-- For example, the following fragment of an Ada 95 program only prints out
--Hot!
-- when the contents of the memory location Temperature are greater than 30.
with Text_IO; use Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure if_program is
Temperature : Integer;
begin
--Temperature := 30;
while (True) loop
Put ("Enter the temperature:");
Get (Temperature);
if Temperature <= 30 then --If temperature greater than 30
Put ("its cool"); --Say its hot
New_Line;
elsif (Temperature > 30) and (Temperature <= 40) then
Put ("its hot ");
New_Line;
elsif (Temperature > 40) and (Temperature <= 44) then
Put ("its hot ");
New_Line;
elsif (Temperature > 44) and (Temperature < 49) then
Put ("its horrible ");
New_Line;
elsif Temperature >= 49 then
Put ("Extremly hot ");
New_Line;
end if;
end loop;
end if_program;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -