Advertisement
boykopk

Untitled

Nov 29th, 2017
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp2
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. int x = 1;
  11. string print = "";
  12.  
  13. for (int i1 = 1; i1 < 10; i1++)
  14. {
  15. for (int i2 = 1; i2 < 10; i2++)
  16. {
  17. for (int i3 = 1; i3 < 10; i3++)
  18. {
  19. for (int i4 = 1; i4 < 10; i4++)
  20. {
  21. for (int i5 = 1; i5 < 10; i5++)
  22. {
  23. for (int i6 = 0; i6 < 10; i6++)
  24. {
  25. x = i1 * i2 * i3 * i4 * i5 * i6;
  26. if (x == n)
  27. {
  28. print = print + i1 + i2 + i3 + i4 + i5 + i6 + " ";
  29. }
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
  36. Console.WriteLine(print);
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement