Предмет: Информатика, автор: DazaiOsamu14

Помогите пожалуйста
Алгебра логики
Определите сколько существует различных наборов переменных `x1`, `x2`, `x3`, `x4`, `x5`, `x6`, при которых выражение истинно?
not(x1 or x2) and not(x2 and x3)and not(x4 or not x5) and
(x5 xor x6) and not(x1 and x4) = true

Ответы

Автор ответа: DogDogGo
1

// Pascal ABC.Net

// Ответ: 2

const

 N = 6;

var

 x: Array [1 .. N] of Boolean;

 count: Integer;

 

procedure rec(k: Integer);

var l: Boolean;

begin

 if k > N then begin

   if not(x[1] or x[2])

     and not(x[2] and x[3])

     and not(x[4] or not x[5])

     and (x[5] xor x[6])

     and not(x[1] and x[4]) = true

   then

     Inc(count);

 end

 else begin

   for l := false to true do begin

     x[k] := l;

     rec(k+1);

   end;

 end;

end;

begin

 count := 0;

 rec(1);

 WriteLn(count);

end.


DogDogGo: P.S. Я тупой тут спокойно можно циклом)
DazaiOsamu14: Спасибо
Похожие вопросы
Предмет: Русский язык, автор: LERALERA2008