if_program.adb.dg

来自「This contains the following topics and m」· DG 代码 · 共 34 行

DG
34
字号

with ada;
with text_io;
use text_io;
with ada.ada__integer_text_io;
use ada.ada__integer_text_io;

procedure if_program is
   temperature : integer;
   L_1 : label
begin
   L_1 : while (true) loop
      ada__text_io__put__4 ("Enter the temperature:");
      ada__integer_text_io__get__2 (temperature, width => 0);
      if temperature <= 30 then
         ada__text_io__put__4 ("its cool");
         ada__text_io__new_line__2 (spacing => 1);
      elsif (temperature > 30) and (temperature <= 40) then
         ada__text_io__put__4 ("its hot ");
         ada__text_io__new_line__2 (spacing => 1);
      elsif (temperature > 40) and (temperature <= 44) then
         ada__text_io__put__4 ("its hot ");
         ada__text_io__new_line__2 (spacing => 1);
      elsif (temperature > 44) and (temperature < 49) then
         ada__text_io__put__4 ("its horrible ");
         ada__text_io__new_line__2 (spacing => 1);
      elsif temperature >= 49 then
         ada__text_io__put__4 ("Extremly hot ");
         ada__text_io__new_line__2 (spacing => 1);
      end if;
   end loop L_1;
   return;
end if_program;

⌨️ 快捷键说明

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