Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.print("Enter your number here: ");
- int number = Integer.parseInt(sc.nextLine());
- System.out.println("The special numbers are: ");
- for(int i1 = 1;i1<=9;i1++){
- for(int i2 = 1;i2<=9;i2++){
- for(int i3 = 1;i3<=9;i3++){
- for(int i4 = 1;i4<=9;i4++){
- if(number%i4 == 0 && number%i3 == 0 && number%i2 == 0 && number%i1 == 0){
- System.out.print(String.format("%d%d%d%d ", i1,i2,i3,i4));
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment