program SwapNeighboringElements;
varnumbers: array[1..10] of Integer;i, tmp: Integer;
beginfor i := 1 to 10 dobeginnumbers[i] := i * 10; // fill the array with numbers 10, 20, 30, ... . 100Write(numbers[i], ' ');end;
Writeln;
for i := 1 to 9 dobegintmp := numbers[i];numbers[i] := numbers[i + 1];numbers[i + 1] := tmp;end;
for i := 1 to 10 doWrite(numbers[i], ' ');
end.
program SwapNeighboringElements;
var
numbers: array[1..10] of Integer;
i, tmp: Integer;
begin
for i := 1 to 10 do
begin
numbers[i] := i * 10; // fill the array with numbers 10, 20, 30, ... . 100
Write(numbers[i], ' ');
end;
Writeln;
for i := 1 to 9 do
begin
tmp := numbers[i];
numbers[i] := numbers[i + 1];
numbers[i + 1] := tmp;
end;
for i := 1 to 10 do
Write(numbers[i], ' ');
end.