Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Exam_26_March_2016 - created by borkins on 2017-05-14.
- */
- import java.util.Scanner;
- public class _06_MagicNumbers
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int magicNum = Integer.parseInt(console.nextLine());
- for (int i = 1; i <= 9; i++)
- {
- for (int j = 1; j <= 9; j++)
- {
- for (int k = 1; k <= 9; k++)
- {
- for (int l = 1; l <= 9; l++)
- {
- for (int m = 1; m <= 9; m++)
- {
- for (int n = 1; n <= 9; n++)
- {
- int num = i * j * k * l * m * n;
- if (num == magicNum)
- {
- System.out.printf("%d%d%d%d%d%d ", i, j, k, l, m, n);
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment