Package cn.hncu.day7;
public class Meeting2 {
public static void Main (string[] args) {
for (int a1=1;a1<=2;a1++) {//1 represents go, 2 means not to go
for (int a2=1;a2<=2;a2++) {
for (int a3=1;a3<=2;a3++) {
for (int a4=1;a4<=2;a4++) {
for (int a5=1;a5<=2;a5++) {
for (int a6=1;a6<=2;a6++) {
if (tm (A1,A2,A3,A4,A5,A6)) {
System.out.println ("a1=" +a1+ ", a2=" +a2+ ", a3="
+a3+ ", a4=" +a4+ ", a5=" +a5+ ", a6=" +A6 ";
}
}
}
}
}
}
}
}
private static int Countgo (int ... AS) {//Statistics There are several people going
int sum=0;
for (int a:as) {
if (a==1) {
sum++;
}
}
return sum;
}
public static Boolean TM (int a1,int a2,int a3,int a4,int a5,int a6) {
if (! ( Countgo (A1,A2) >=1) {//Condition 1 Guard
return false;
}
if (! ( Countgo (A1,A5,A6) ==2) {//Condition 2 Guard
return false;
}
if (Countgo (A2,A3) ==1) {//Condition 3 guard
return false;
}
if (! ( Countgo (A1,A4) ==1) {//Condition 4 Guard
return false;
}
if (! ( Countgo (A3,A4) ==1) {//Condition 5 Guard
return false;
}
if (a4==2&&a5==1) {//The guard of condition 6
return false;
}
return true;
}
}
On the condition of who came to attend the subject of the meeting