Advertisement
chono55

SpecNum2

Jun 24th, 2019
872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SpecialnumbersBoolean {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int N = Integer.parseInt(scanner.nextLine());
  8.  
  9.         for(int i = 1; i <= 9;i++){
  10.             if(N%i != 0){
  11.                continue;
  12.             }
  13.             for(int o = 1;o <= 9;o++){
  14.                 if(N%o != 0){
  15.                     continue;
  16.                 }
  17.                 for(int p = 1;p <= 9;p++){
  18.                     if(N%p != 0){
  19.                         continue;
  20.                     }
  21.                     for (int a = 1; a <= 9;a++){
  22.                         if(N%a != 0){
  23.                             continue;
  24.                         }
  25.                             System.out.printf("%d%d%d%d ",i,o,p,a);
  26.  
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement