A task needs to be completed in the five persons of a, B, C, D, E, but the person is limited to the following conditions:
(1) If a goes, then B goes with it.
(2) D,e two people will go
(3) B,c Two people will go, but only one person
(4) C,d either go, or neither.
(5) If e goes, then A and B will go to
Analysis:
For this example of logic judgment, we get the logical expression of the condition, and we have the solution mode of the logic judgment class. If each person's go and not to be seen as a 5-bit integer in which 1, where a pair with the highest level, E corresponds to the lowest bit, then all the possible redeployment scheme is from all the non-assigned 00000 to all of the 11111 changes between the pi. Clearly, there are 32 scenarios in which all loops are:
The descendants of a, B, C, D, E are then entered into the expression, that is, the program can be constituted:
C + + code: bit operation instance (bit operation example)