Yurttas/PL/IL/Ada-95/F/01/PU/minni.adb

From ZCubes Wiki
Revision as of 04:44, 5 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="ada" line start="1" enclose="div">-- -- date : January 1, 1998. -- author : Salih Yurttas. -- purpose : computation of the minimum of a given intege...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1--
 2
 3-- date   : January 1, 1998.
 4-- author : Salih Yurttas.
 5
 6-- purpose : computation of the minimum of a given integer list.
 7
 8-- minni.adb
 9
10with Minimum_of_N_Integers_P; use Minimum_of_N_Integers_P;
11
12procedure Minimum_of_N_Integers is
13
14  Max_Size : constant Integer := 16;
15
16  Data_Count,
17  Minimum_Found,
18  Minimum_Index  : Integer;
19
20  Data : Integer_List(1..Max_Size);
21
22begin
23
24-- input the list of elements, and
25-- count for the number of elements in the given list.
26
27  Get_Integer_List(Data_Count,
28                   Data);
29
30-- compute the minimum of Count<=Max_Size integers.
31
32  Find_Min_of_Integer_List(Minimum_Found,
33                           Minimum_Index,
34                           Data_Count,
35                           Data);
36
37-- output the minimum found.
38
39  Put_Minimum_of_Integer_List(Minimum_Found,
40                              Minimum_Index);
41
42end Minimum_of_N_Integers;