Program R1; Var a:array[1..100] of integer; i,n:integer; begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); readln(n); for i:=1 to n do read(a[i]); for i:=n+1 downto 2 do a[i]:=a[i-1] ; a[1]:=7 ;
for i:=1 to n+1 do write(a[i],' '); close(input); close(output); end.
var a:array [1..100] of integer;
i,n:integer;
Begin
read(n);
for i:= 1 to n do
read(a[i]);
for i:= n downto 1 do
a[i+1]:=a[i];
a[1]:=7;
for i:=1 to n+1 do
write(a[i],' ');
End.
Program R1;
Var a:array[1..100] of integer;
i,n:integer;
begin
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);
readln(n);
for i:=1 to n do read(a[i]);
for i:=n+1 downto 2 do
a[i]:=a[i-1] ;
a[1]:=7 ;
for i:=1 to n+1 do write(a[i],' ');
close(input);
close(output);
end.
например
ввод
4
1 2 3 4
вывод
7 1 2 3 4