fork download
  1. WITH Ada.Text_IO, Ada.Integer_Text_IO;
  2. USE Ada.Text_IO, Ada.Integer_Text_IO;
  3.  
  4. PROCEDURE Prog3 IS
  5. a, b, c:integer:=0;
  6. Max :Integer;
  7.  
  8. BEGIN
  9.  
  10. max:=integer'first;
  11. LOOP
  12. A:=B;
  13. b:=c;
  14.  
  15. Put("Podaj liczbe: ");
  16. Get(c);
  17. EXIT WHEN c=0;
  18.  
  19. IF A>B AND A >C THEN
  20. Max:=A;
  21. end if;
  22.  
  23. IF b>a AND b >C THEN
  24. max:=b;
  25. end if;
  26.  
  27. IF c>a AND c >b THEN
  28. max:=c;
  29. END IF;
  30.  
  31.  
  32. end loop;
  33. Put("Najwieksza liczba to: ");
  34. Put(Max);
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. end prog3;
Runtime error #stdin #stdout 0.01s 1868KB
stdin
Standard input is empty
stdout
Podaj liczbe: