On the condition of who came to attend the subject of the meeting

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.