about summary refs log tree commit diff
path: root/others/volume1/053.pas
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-15 11:33:54 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-15 11:33:54 +0700
commit5a44eb260b9b35096df7371a702ba99b7265b3f9 (patch)
tree60ad135076dbca49d1e20eac540c53bdd6e8b97a /others/volume1/053.pas
parentfa7cbaee4baf174ee416280d82a60fade6d3eaad (diff)
downloadcp-5a44eb260b9b35096df7371a702ba99b7265b3f9.tar.gz
Update others/volume1
Diffstat (limited to 'others/volume1/053.pas')
-rw-r--r--others/volume1/053.pas20
1 files changed, 20 insertions, 0 deletions
diff --git a/others/volume1/053.pas b/others/volume1/053.pas
new file mode 100644
index 0000000..f3c8a4e
--- /dev/null
+++ b/others/volume1/053.pas
@@ -0,0 +1,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.