CONST el = 10 ' Elementov v massive
DIM M1%(el), M2%(el), M3%(el), nf%, ind%
FOR i = 1 TO el
INPUT "element M1 ", M1%(i)
INPUT "element M2 ", M2%(i)
NEXT
' Ishchem nepovtorenie el-ta 1-go massiva vo vtorom i perekidivaem v 3-i massiv
FOR ivne = 1 TO el
nf% = 1 ' Flag nakhozhdeniya konkretnogo elementa pervogo massiva vo vtorom
FOR ivnu = 1 TO el
IF M1%(ivne) = M2%(ivnu) THEN nf% = 0
NEXT
IF nf% = 1 THEN ind% = ind% + 1: M3%(ind%) = M1%(ivne)
NEXT
' Vivod na ekran
CLS: PRINT "Massiv 1"
FOR i = 1 TO el: PRINT M1%(i);
NEXT: PRINT CHR$(13) + "Massiv 2"
FOR i = 1 TO el: PRINT M2%(i);
NEXT: PRINT CHR$(13) + "Massiv 3"
FOR i = 0 TO ind%: PRINT M3%(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )