.
..
ex01a.adb (download) (view)
ex01b.adb (download) (view)
ex02.adb (download) (view)
ex03a.adb (download) (view)
ex03b.adb (download) (view)
ex03c.adb (download) (view)
ex03d.adb (download) (view)

with Ada.Text_Io, Ada.Integer_Text_Io;
use Ada.Text_Io, Ada.Integer_Text_Io;

procedure Ex01b is
   --- Début algo ---
   function Min(A, B : Natural) return Natural is
   begin
      if A < B then
         return A;
      else
         return B;
      end if;
   end Min;

   function Max(A, B : Natural) return Natural is
   begin
      if A > B then
         return A;
      else
         return B;
      end if;
   end Max;
   --- Fin   algo ---

   X, Y, Z, T : Natural;
begin
   Get(X); Get(Y); Get(Z); Get(T);
   Put("X = ");   Put(X, 1);   Put("  Y = "); Put(Y, 1);
   Put("  Z = "); Put(Z, 1);   Put("  T = "); Put(T, 1); New_Line;

   --- Début algo ---
   Put("Max(x, y) + Min(z, t) = "); Put(Max(X, Y) + Min(Z, T));
   --- Fin   algo ---
end;
 
Webmaster : pierrefrancois.leon@laposte.net

Valid XHTML 1.0 Strict Valid CSS!