damyan91

Untitled

Aug 24th, 2016
244
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 _06.MagicCombination
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14.  
  15. int product = 1;
  16.  
  17. for (int a = 1; a <= 9; a++)
  18. {
  19. for (int b = 1; b <= 9; b++)
  20. {
  21. for (int c = 1; c <= 9; c++)
  22. {
  23. for (int d = 1; d <= 9; d++)
  24. {
  25. for (int e = 1; e <= 9; e++)
  26. {
  27. for (int f = 1; f <= 9; f++)
  28. {
  29. product = a * b * c * d * e * f;
  30. if (product == n)
  31. {
  32. Console.Write("{0}{1}{2}{3}{4}{5} ", a, b, c, d, e, f);
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment