谢谢了!另附一下代码。。
#include <iostream>
#include <cstdlib>
using namespace std;
#define NOTAKE 0
#define TAKE 1
#define A (players & 0x01)
#define B ((players & 0x02)>>1)
#define C ((players & 0x04)>>2)
#define D ((players & 0x08)>>3)
#define E ((players & 0x10)>>4)
int players;
void test();
bool check();
int main()
{
test();
system("pause");
return 0;
}
void test()
{
for (players = 0; players < 32; players++)
{
if (check())
{
if (A == TAKE){cout << "A ";}
if (B == TAKE){cout << "B ";}
if (C == TAKE){cout << "C ";}
if (D == TAKE){cout << "D ";}
if (E == TAKE){cout << "E ";}
cout<<endl;
}
}
}
bool check()
{
bool False = false ;
if (((A == TAKE)? B == TAKE: true)
&& (B != C)
&& (C == D)
&& (D == TAKE || E == TAKE)
&& (E == TAKE? (A == TAKE && D == TAKE): true))
{
return true;
}
else
{
return False;
}
}
[
本帖最后由 andly2013 于 2013-7-11 18:52 编辑 ]