fork download
  1. with Ada.Integer_Text_Io, Ada.Text_Io;
  2. use Ada.Integer_Text_Io, Ada.Text_Io;
  3.  
  4. procedure Test is
  5. subtype Input_number is Integer range 0..10;
  6. Input : Input_number;
  7. type Colors is (Red, Green, Blue, Magenta, Cyan, Yellow);
  8. subtype Primary_colors is Colors range Red..Blue;
  9. Selected_color : Colors;
  10. Subcolor : Primary_colors;
  11. begin
  12. Get(Input);
  13. Selected_color:= Red;
  14. if Selected_color in Subcolor then
  15. Put ("Primary Color ");
  16. New_Line;
  17. else
  18. Put ("Secondary Color");
  19. New_Line;
  20. end if;
  21. Put(Input);
  22. New_Line;
  23. end;
  24.  
Success #stdin #stdout 0.01s 5424KB
stdin
10
stdout
Primary Color 
         10