[C #] 4-9-square lattice Algorithms
The netizens in the group threw out such a question.
My algorithms:
Static void Main (string [] args) {/** a + B-9 = 4 * +--* c-d * e = 4 */*-* f + g-h = 4 * | | * 4 4 4 **/int flag = 50; for (int a = 0; a <14; a ++) // a {for (int B = 0; B <14; B ++) // B {// a + B-9 = 4 so a + B = 13 if (a + B) = 13) {// 9-e-h = 4 e + h = 5, e <6, h <6 for (int e = 0; e <6; e ++) // e {for (int h = 0; h <6; h ++) // h {if (e + h) = 5) {for (int c = 0; c <flag; c ++) // c {// B-d * g = 4, B [0-13] d * g <10, d, g <10 for (int d = 0; d <10; d ++) // d * g <= 9 {for (int g = 0; g <10; g ++) // g {// considering that f is the dividend, therefore, f> 0, consider Division c % f = 0 for (int f = 1; f <flag; f ++) // f {while (c % f) = 0 & (c-d * e) = 4 & (f + g-h) = 4 & (a + c/f) = 4 & (B-d * g) = 4) {Console. writeLine ("----------------------------------"); Console. write ("a: {0}",. toString (); Console. write ("B: {0}", B. toString (); Console. write ("c: {0}", c. toString (); Console. write ("d: {0}", d. toString (); Console. write ("e: {0}", e. toString (); Console. write ("f: {0}", f. toString (); Console. write ("g: {0}", g. toString (); Console. writeLine ("h: {0}", h. toString (); Console. writeLine ("----------------------------------"); Console. readLine ();}}}}}}}}}}}}