Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class magicNumbers {
  4. public static void main(String[] args) {
  5. Scanner scanner=new Scanner(System.in);
  6. int num=Integer.parseInt(scanner.nextLine());
  7. for(int x1=0;x1<=9;x1++)
  8. {
  9. for(int x2=0;x2<=9;x2++)
  10. {
  11. for(int x3=0;x3<=9;x3++)
  12. {
  13. for(int x4=0;x4<=9;x4++)
  14. {
  15. for(int x5=0;x5<=9;x5++)
  16. {
  17. for(int x6=0;x6<=9;x6++)
  18. {
  19. if(num==x1*x2*x3*x4*x5*x6)
  20. {
  21. System.out.print(x1);
  22. System.out.print(x2);
  23. System.out.print(x3);
  24. System.out.print(x4);
  25. System.out.print(x5);
  26. System.out.print(x6);
  27. System.out.print(" ");
  28. }
  29. }
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement