#include<stdio.h>
int main()
{
char killer;
for (killer = 'A'; killer <= 'D'; killer++)
{
if (((killer != 'A') + (killer == 'C') + (killer == 'D') + (killer != 'D')) == 3)
{
printf("凶手是%c\n", killer);
break;
}
}
system("pause");
return 0;
}
((killer != 'A') + (killer == 'C') + (killer == 'D') + (killer != 'D')) == 3 //**关键语句
已知真为1,假为0,三人说真话,一人说假话。因此将四人语句加起来的和为3