Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Matrix {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int a = Integer.parseInt(scanner.nextLine());
- int b = Integer.parseInt(scanner.nextLine());
- int c = Integer.parseInt(scanner.nextLine());
- int d = Integer.parseInt(scanner.nextLine());
- for (int i = a; i < b; i++) {
- for (int j = a +1; j <= b; j++) {
- if(i == j){continue;}
- for (int k = c; k < d; k++) {
- for (int f = c+1; f <= d; f++) {
- if(k == f){continue;}
- if (i + f == j + k) {
- System.out.printf("%d%d%n", i, j);
- System.out.printf("%d%d%n", k, f);
- System.out.println();
- System.out.printf("%d%d%n", j, i);
- System.out.printf("%d%d%n", f, k);
- System.out.println();
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment