Всего вариантов: 46
Const { А Б В Г Д Е Ж З И К }
m : array[1..10,1..10] of Byte = ((0,1,1,1,1,0,0,0,0,0), { А }
(0,0,1,0,0,1,0,0,0,0), { Б }
(0,0,0,1,0,0,1,0,0,0), { В }
(0,0,0,0,1,0,0,1,0,0), { Г }
(0,0,0,0,0,0,0,1,1,0), { Д }
(0,0,0,0,0,0,1,0,0,0), { Е }
(0,0,0,0,0,0,0,0,0,0), { Ж }
(0,0,0,0,0,0,1,0,1,1), { З }
(0,0,0,0,0,0,0,0,0,1), { И }
(0,0,0,0,0,1,1,0,0,0)); { К }
p : String[10] = 'АБВГДЕЖЗИК';
Var C : Integer;
Procedure Go(n : Byte; s : String);
Var i : Byte;
Begin
If n=7 then
Begin
Writeln(s);
Inc(C);
end
else
For i:=1 to 10 do
If m[n,i]=1 then Go(i,s+p[i]);
end;
Begin
C:=0;
Go(1,'А');
Writeln('Всего вариантов: ',C);
end.