Static voidMain21 Scout (string[] args) { //A reconnaissance team received an urgent task requiring as many persons as possible in A, B, C, D, E and F six players, subject to the following restrictions://Scout A and B at least one of the two men; A+b>=1//A and D cannot go together; A+d<=1//A, E and F three shall send two men; a+e+f = = 2//B and C neither go nor go; B+c!=1//C and D Two of people go to one; C+d==1//If D does not go, then E will not go. d+e==0 | | D=1//How many people should I ask for? A reconnaissance team received an urgent task requiring as many persons as possible in A, B, C, D, E and F six players, subject to the following restrictions://Scout A and B at least one of the two men; A+b>=1//A and D cannot go together; A+d<=1//A, E and F three shall send two men; a+e+f = = 2//B and C neither go nor go; B+c!=1//C and D Two of people go to one; C+d==1//If D does not go, then E will not go. d+e==0 | | D=1//How many people should I ask for? for(intA =0; A <=1; a++) { for(intb =0; b <=1; b++) { for(intc =0; C <=1; C++) { for(intD =0; D <=1; d++) { for(intE =0; E <=1; e++) { for(intf =0; F <=1; f++) { if(A + B >=1&& A + D <=1&& A + e + f = =2&& B + c! =1&& C + D = =1&& (d + e = =0|| D = =1) {Console.WriteLine ("A:"+ A +"\NB:"+ B +"\NC:"+ C +"\nd:"+ D +"\ne:"+ E +"\NF:"+f); } } } } } } } } Static voidMain22 plus SIGN (string[] args) { //1 () 2 () 3 () 4 = 4; Ask in parentheses I want to fill in (-or +) for(intA =-1; A <=1; a=a+2) { for(intb =-1; b <=1; b=b+2) { for(intc =-1; C <=1; c=c+2) { if(1+ A *2+ b *3+ c *4==4) {Console.WriteLine ("1+"+a*2+"+"+b*3+"+"+c*4+"=4"); } } } } } Static voidThe Main23 equation was established (string[] args) { //123 () 45 () 67 () 8 () 9=100; required to fill in the () + or-to set the equation. for(intA =-1; A <=1; a=a+2) { for(intb =-1; b <=1; B = B +2) { for(intc =-1; C <=1; c = C +2) { for(intD =-1; D <=1; D = d +2) { if(123+ A * $+ b * the+ c *8+ D *9== -) {Console.WriteLine ("123+"+a+"+*45+"+b+"+*67+"+c+"+*8+"+d+"+9=100"); } } } } } }
For practice--scout