const n=15;
var a: array[1..n] of integer;
i,s:integer;
begin
randomize;
for i:=1 to n do
a[i]:=random(21)-10;
write(a[i],' ');
end;
writeln;
for i:=1 to n div 2 do
s:=a[i];
a[i]:=a[n-i+1];
a[n-i+1]:=s;
end.
Объяснение:
const n=15;
var a: array[1..n] of integer;
i,s:integer;
begin
randomize;
for i:=1 to n do
begin
a[i]:=random(21)-10;
write(a[i],' ');
end;
writeln;
for i:=1 to n div 2 do
begin
s:=a[i];
a[i]:=a[n-i+1];
a[n-i+1]:=s;
end;
for i:=1 to n do
write(a[i],' ');
end.
Объяснение: