const n=10; var a:array[1..n] of integer; i,min,max:integer; begin for i:=1 to n do a[i]:=random(50); for i:=1 to n do write(a[i]:4); writeln; min:=32000; max:=-32000; for i:=1 to n do if a[i]<min then min:=a[i]; for i:=1 to n do if a[i]>max then max:=a[i]; writeln('минимальный элемент массива = ',min); writeln('максимальный элемент массива= ',max); end.
2.
const n=10; var a:array[1..n] of integer; i,j,p:integer; begin for i:=1 to n do a[i]:=random(20); for i:=1 to n do write(a[i]:4); writeln; for i:=1 to n-1 do begin for j:=1 to n-1 do if a[j]<=a[j+1] then begin p:=a[j]; a[j]:=a[j+1]; a[j+1]:=p; end; end; for i:=1 to n do write(a[i]:4); end.
const n=10;
var a:array[1..n] of integer;
i,min,max:integer;
begin
for i:=1 to n do a[i]:=random(50);
for i:=1 to n do write(a[i]:4);
writeln;
min:=32000; max:=-32000;
for i:=1 to n do
if a[i]<min then min:=a[i];
for i:=1 to n do
if a[i]>max then max:=a[i];
writeln('минимальный элемент массива = ',min);
writeln('максимальный элемент массива= ',max);
end.
2.
const n=10;
var a:array[1..n] of integer;
i,j,p:integer;
begin
for i:=1 to n do a[i]:=random(20);
for i:=1 to n do write(a[i]:4);
writeln;
for i:=1 to n-1 do begin
for j:=1 to n-1 do
if a[j]<=a[j+1] then begin
p:=a[j]; a[j]:=a[j+1]; a[j+1]:=p;
end;
end;
for i:=1 to n do write(a[i]:4);
end.