Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SpecialNumbers {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- for (int n1 = 1; n1 <= 9; n1++) {
- for (int n2 = 1; n2 <= 9; n2++) {
- for (int n3 = 1; n3 <= 9; n3++) {
- for (int n4 = 1; n4 <= 9; n4++) {
- if (n % n1 == 0 && n % n2 == 0 && n % n3 == 0 && n % n4 == 0) {
- System.out.printf("%d%d%d%d ", n1, n2, n3, n4);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement