Untitled
raw download clone
PASCAL
views 24
,
size 960 b
program Array1_4;
var
    two_degree  : array[1..12] of integer;
    rnd_array   : array[1..15] of integer;
    i           : integer;
    s           : string;
    max         : integer;
    total       : integer;
begin
    for i:=1 to 12 do 
        begin
            if i=1 then two_degree[i]:=2 else two_degree[i]:=two_degree[i-1]*2;
            str(two_degree[i], s);
            if length(s)>=4 then writeln (two_degree[i]);
        end;
   
    total:=0;
    for i:=1 to 15 do 
        begin
            rnd_array[i]:=random(101);
            if i=1 then max:=rnd_array[i] else
                begin
                    if rnd_array[i]>max then max:=rnd_array[i];
                    if rnd_array[i]>rnd_array[i-1] then
                        begin
                            writeln (i);
                            total:=total+rnd_array[i];
                        end;
                end;
        end;
        
end.
close fullscreen
Login or Register to edit or fork this paste. It's free.