/*
==================================================================
Title: B-Butyl Four people guess A,b,c,d,e,f6 individual who is the champion, a said not A is B, B said
Definitely not C, and C said it could not be a and B, Ding said is a or B, the game results said four people only one
That's right!
==================================================================
*/
#include <stdio.h>
Main ()
{
int jia,yi,bin,ding;
char i;
for (i= ' A '; i<= ' F '; i++)
{
Jia= (i== ' A ' | | i== ' B ');//actually are logical judgments, really 1, false for 0, thereby achieving the additive, finally add up is a few people say right!
yi= (i!= ' C ');
bin= (i!= ' A ' &&i!= ' B ');
ding= (i== ' A ' | | i== ' B ');
if (jia+yi+bin+ding==1)
printf ("The Championship is:%c\n", i);
}
}
/*
==================================================================
Comments: The four people's statement in a logical language, really 1, false 0, four people added to a few
That's right! You can modify the IF statement to have a value of 2 or 3 to try (2 or 3 people say yes).
==================================================================
*/
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The basic algorithm of C language 12-who is the champion