Напишите программу для дублирования элементов массива
Answers & Comments
maksimovalbert
Const nn=35; var i,n,t:integer; a:array[1..nn] of integer; begin Readln(n); for i:=1 to n do Read(a[i]); for i:=1 to n div 2 do begin t:=a[i]; a[i]:=a[n-i+1]; a[n-i+1]:=t end; for i :=1 to n do Write(a[i],' '); Writeln end.
Answers & Comments
nn=35;
var
i,n,t:integer;
a:array[1..nn] of integer;
begin
Readln(n);
for i:=1 to n do Read(a[i]);
for i:=1 to n div 2 do begin
t:=a[i]; a[i]:=a[n-i+1]; a[n-i+1]:=t
end;
for i :=1 to n do
Write(a[i],' ');
Writeln
end.