2 câu trả lời
uses crt;
var a,b:array[0..1000000] of longint;
i,n,m:longint;
begin
clrscr;
write('Nhap do dai cho 2 mang: ');
readln(n,m);
write('Nhap mang a: ');
for i:=1 to n do read(a[i]);
write('Nhap mang b: ');
for i:=1 to m do read(b[i]);
for i:=1 to n do b[i+m]:=a[i];
write('Mang b sau khi duoc ghep: ');
for i:=1 to n+m do write(b[i],' ');
readln;readln;
end.
var a,b:array[0..10000007] of longint;
i,n,m,k:longint;
begin
readln(n,m);
for i := 1 to n do read(a[i]);
for i := 1 to m do read(b[i]);
k := m;
for i := 1 to n do
b[k+i] := a[i];
for i := 1 to n + k do
write(b[i],#32);
readln;readln
end.