ZhivkoPetkov

Lucky Numbers

Mar 22nd, 2018
598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         int start = Integer.parseInt(sc.nextLine());
  8.  
  9.         for (int i = 1; i <= 9; i++) {
  10.             for (int j = 1; j <= 9; j++) {
  11.                 for (int k = 1; k <= 9; k++) {
  12.                     for (int l = 1; l <= 9; l++) {
  13.                         if ((i+j)==(k+l)) {
  14.                             if ((start%(i+j)==0)){
  15.                                 System.out.printf("%d%d%d%d ",i,j,k,l);
  16.                             }
  17.                         }
  18.                         }
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment