Advertisement
Guest User

Untitled

a guest
Sep 15th, 2014
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1.         // (a ≠ b ≠ c ≠ d)
  2.         for (int a = 0; a < numbers.length; a++) {
  3.             for (int b = 0; b < numbers.length; b++) {
  4.                 if (a != b) {
  5.                     for (int c = 0; c < numbers.length; c++) {
  6.                         if (a!= c && b != c) {
  7.                             for (int d = 0; d < numbers.length; d++) {
  8.                                 if (a != d && b != d && c != d) {
  9.                                    
  10.                                     String left = "" + numbers[a] + numbers[b];
  11.                                     String right = "" + numbers[c] + numbers[d];
  12.                                    
  13.                                     if (left.equals(right)) {
  14.                                         foundStucks = true;
  15.                                         System.out.printf("%d|%d==%d|%d\n", numbers[a], numbers[b], numbers[c], numbers[d]);
  16.                                     }
  17.                                 }
  18.                             }
  19.                         }
  20.                     }
  21.                 }
  22.             }
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement