Lyubohd

Matrix

Feb 22nd, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Demo {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int a = Integer.parseInt(scan.nextLine());
  8.         int b = Integer.parseInt(scan.nextLine());
  9.         int c = Integer.parseInt(scan.nextLine());
  10.         int d = Integer.parseInt(scan.nextLine());
  11.  
  12.         for (int i = a; i <= b; i++) {
  13.             for (int j = a; j <= b; j++) {
  14.                 for (int k = c; k <= d; k++) {
  15.                     for (int l = c; l <= d; l++) {
  16.                         if (i + l == j + k) {
  17.                             if (i != j && k != l) {
  18.                                 System.out.println(i + "" + j);
  19.                                 System.out.println(k + "" + l);
  20.                                 System.out.println();
  21.                             }
  22.                         }
  23.                     }
  24.                 }
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment