--
-- This is a test of records and arrays together.
--
package test26 is body
    type pair is record first, second : float; end record;
    type list is array [1..10] of pair;
    b : list;
    x : float;
    i, j, k : integer; 
begin 
    read (i); 
    j := 0;
    loop 
        j := j + 1; 
        read (b[j].first); b[j].second := b[j].first;
        exit when i == j;
    end loop;
    j := 1;
    loop 
        k := j; 
        loop
            if b[j].first > b[k].first then
                x := b[k].first; b[k].first := b[j].first; b[j].first := x; 
            elsif k < 10 then k := k + 1;
            else exit; 
            end if;
        end loop; 
        exit when j == 10; 
        j := j + 1; 
    end loop;
    j := 1;
    write ("the original and sorted lists are:");
    write ("");
    loop 
        write (b[j].second, b[j].first); j := j + 1; 
        exit when j == 11; 
    end loop;
end.
