/* A group selects A number of views from the following areas: A, B, C, D, and E:
1) If you want to remove A, you must go to B;
2) D and E can only go to one location;
3) B and C can only go to one location;
4) C. D. Neither go nor go;
5) if you go to E, A and D will also go.
Where can the group go at most?
*/
[Cpp]
# Include "stdio. h"
# Include "stdlib. h"
# Include "time. h"
Int main ()
{Int a, B, c, d, e;
Int x [5];
For (a = 0; a <2; a ++)
For (B = 0; B <2; B ++)
For (c = 0; c <2; c ++)
For (d = 0; d <2; d ++)
For (e = 0; e <2; e ++)
{// Five if conditions correspond to five conditions respectively
If (a & B | (a = 0 & B = 0 ))
If (d + e <2)
If (B + c <2)
If (c & d)
If (e & a & d | (e = 0 ))
{X [0] = a; x [1] = B; x [2] = c; x [3] = d; x [4] = e;
For (int I = 0; I <5; I ++)
If (x [I])
Printf ("% c will be arrived \ n", 'A' + I );
}}
Printf ("\ n ");
System ("pause ");
}
# Include "stdio. h"
# Include "stdlib. h"
# Include "time. h"
Int main ()
{Int a, B, c, d, e;
Int x [5];
For (a = 0; a <2; a ++)
For (B = 0; B <2; B ++)
For (c = 0; c <2; c ++)
For (d = 0; d <2; d ++)
For (e = 0; e <2; e ++)
{// Five if conditions correspond to five conditions respectively
If (a & B | (a = 0 & B = 0 ))
If (d + e <2)
If (B + c <2)
If (c & d)
If (e & a & d | (e = 0 ))
{X [0] = a; x [1] = B; x [2] = c; x [3] = d; x [4] = e;
For (int I = 0; I <5; I ++)
If (x [I])
Printf ("% c will be arrived \ n", 'A' + I );
}}
Printf ("\ n ");
System ("pause ");
} // Of course, only x [0] ~ can be used. X [4]. Here a, B, c, d, and e are used for intuition and convenience only.