//定义变量abcdef来代表abcdef六个队员
var a, b, c, d, e, f;
//for循环遍历每个人都可能去的情况
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++) {
for (f = 0; f < 2; f++) {
//限制条件
if ((a + b >= 1) && (a + d < 2) && (a + e + f == 2) && (b + c == 2 || b + c == 0) && (c + d == 1) && ((d==1&&e==0) || (d ==0 &&e == 0)||(d==1&&e==1))) {
//去的队员对应变量为1
console.log(a, b, c, d, e, f);
var str = "";
//1为true 就在str中添加对应的该队员
if(a){
str+="a";
}
if(b){
str+="b";
}
if(c){
str+="c";
}
if(d){
str+="d";
}
if(e){
str+="e";
}
if(f){
str+="f";
}
//str即去的人员
console.log(str);
}
}
}
}
}
}
}