Program gt; var a:array[1..12]of integer; n,i,max:integer; begin randomize; for i:=1 to 12 do begin a[i]:=random(100)-50; write(a[i],' '); end; writeln; write(a[2],' ',a[3],' ',a[4],' ',a[9],' ',a[12],' '); max:=a[1]; for i:=2 to 12 do begin if(a[i]>max)then max:=a[i]; end; writeln(max); end.
Uses crt; const N=12; var mas: array [1..N] of integer; x,max: integer; begin randomize; for x:=1 to N do begin mas[x]:=random(99)+1; writeln('mas[',x,']:',mas[x]); end; max:=mas[1]; for x:=1 to N do if mas[x]>max then max:=mas[x]; writeln; writeln(mas[2],' ',mas[3],' ',mas[4],' ',mas[9],' ',mas[12]); writeln('max=',max); readln; end.