saimun1

Magic number generator

Jul 22nd, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace test5
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int magic = int.Parse(Console.ReadLine());
  14. for (int d1 = 0; d1 <=9; d1++)
  15. {
  16. for (int d2 = 0; d2 <= 9; d2++)
  17. {
  18. for (int d3 = 0; d3 <= 9; d3++)
  19. {
  20. for (int d4 = 0; d4 <= 9; d4++)
  21. {
  22. for (int d5 = 0; d5 <= 9; d5++)
  23. {
  24. for (int d6 = 0; d6 <= 9; d6++)
  25. {
  26. if (d1 * d2 * d3 * d4 * d5 * d6 == magic)
  27. {
  28. Console.WriteLine("{0}{1}{2}{3}{4}{5}",
  29. d1,d2,d3,d4,d5,d6);
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
  36. }
  37. //Console.ReadLine();
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment