CLS
INPUT "Slovo A:", A$
INPUT "Slovo B:", B$
WHILE A$ <> ""
Smb$ = LEFT$(A$, 1): C$ = ""
FOR j% = 1 TO LEN(B$)
IF MID$(B$, j%, 1) <> Smb$ THEN C$ = C$ + MID$(B$, j%, 1)
NEXT
B$ = C$: C$ = ""
FOR j% = 1 TO LEN(A$)
IF MID$(A$, j%, 1) <> Smb$ THEN C$ = C$ + MID$(A$, j%, 1)
NEXT
A$ = C$
WEND
IF B$ = "" THEN PRINT "Mojno sostavot' slovo B iz bukv slova A"
IF B$ <> "" THEN PRINT "Nelza sostavot' slovo B iz bukv slova A"
Тестирование выполнено в программе QB64 ( Скачать )