CLS
INPUT "vvedite razmer massiva A ", n
INPUT "vvedite razmer massiva B ", m
INPUT "vvedite nomer k ", k
DIM a(n + m), b(m)
RANDOMIZE TIMER
PRINT " massiv a"
FOR i = 1 TO n
a(i) = INT(RND * 20)
PRINT a(i);
NEXT
PRINT
PRINT " massiv b"
FOR i = 1 TO m
b(i) = INT(RND * 20)
PRINT b(i);
NEXT
PRINT
FOR i = n TO k + 1 STEP -1
a(i + m) = a(i)
NEXT
FOR i = k + 1 TO k + m
t = t + 1
a(i) = b(t)
NEXT
PRINT "novyj massiv a"
FOR i = 1 TO n + m
PRINT a(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )