📄 c10.cpp
字号:
// c10.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
int Infer();
int main(int argc, char* argv[])
{
int a = Infer();
switch(a)
{
case 0: cout << "丁是偷盗者!\n"; break;
case 1: cout << "丙是偷盗者!\n"; break;
case 2: cout << "乙是偷盗者!\n"; break;
case 3: cout << "甲是偷盗者!\n"; break;
default: cout << "无法判断!\n"; break;
}
return 0;
}
int Infer()
{
for ( int i = 0; i < 4; i++ )
{
if ( !( 1==(1<<i & 5) || 4 == (1<<i & 5) ) ) continue; // A
if ( !( 2==(1<<i & 6) || 4 == (1<<i & 6) ) ) continue; // B
if ( !( 8==(1<<i & 12) || 4 == (1<<i & 12) ) ) continue; // C
return i;
}
return -1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -