Const n=10; mi=1; ma=10; var a:array[1..n] of integer; i:integer; begin for i:=1 to n do begin a[i]:=random(ma-mi+1)+mi; write(a[i],' ') end; writeln; for i:=1 to n div 2 do begin a[2*i]:=a[2*i]+a[2*i-1]; a[2*i-1]:=a[2*i]-a[2*i-1]; a[2*i]:=a[2*i]-a[2*i-1] end; for i:=1 to n do write(a[i],' ') end.
var a:array[1..n] of integer; i:integer;
begin
for i:=1 to n do begin a[i]:=random(ma-mi+1)+mi; write(a[i],' ') end;
writeln;
for i:=1 to n div 2 do begin a[2*i]:=a[2*i]+a[2*i-1]; a[2*i-1]:=a[2*i]-a[2*i-1]; a[2*i]:=a[2*i]-a[2*i-1] end;
for i:=1 to n do write(a[i],' ')
end.