about summary refs log tree commit diff
path: root/others/volume1/053.pas
blob: f3c8a4e97c4b723c2d98993b923a1d3c792f3bef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var
  n, i: int16;
  a: array of int32;
  v: int32;

begin
  readln(n);
  setlength(a, n + 1);
  for i := 0 to n - 1 do
    read(a[i]);
  readln(i, v);
  repeat
    a[n] := a[n - 1];
    dec(n)
  until n = i;
  a[i - 1] := v;
  for i := 0 to length(a) - 2 do
    write(a[i], ' ');
  writeln(a[length(a) - 1])
end.