var
n,i,q,k,p,:integer;
a,b:array [1..1000] of integer;
begin
write('n= ');readln(n);
for i:=1 to n do
begin
write('a[',i,']= ');
readln(a[i]);
end;
write('-Chen pt va vi tri cua pt do: ');readln(k,p);
q:=0;
for i:=1 to n do
begin
inc(q);
if q=p then begin
b[q]:=k;
inc(q);
end;
b[q]:=a[i];
end;
writeln('-Mang sau khi chen la: ');
for i:=1 to q do
write(b[i],' ');
readln
end.
n,i,q,k,p,:integer;
a,b:array [1..1000] of integer;
begin
write('n= ');readln(n);
for i:=1 to n do
begin
write('a[',i,']= ');
readln(a[i]);
end;
write('-Chen pt va vi tri cua pt do: ');readln(k,p);
q:=0;
for i:=1 to n do
begin
inc(q);
if q=p then begin
b[q]:=k;
inc(q);
end;
b[q]:=a[i];
end;
writeln('-Mang sau khi chen la: ');
for i:=1 to q do
write(b[i],' ');
readln
end.
0 nhận xét:
Đăng nhận xét