Advertisement
Dean2002

Untitled

Nov 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 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 Special_Numbers
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int n = int.Parse(Console.ReadLine());
  15. int rest = 0;
  16. for (int i = 1111; i < 10000; i++)
  17. //for (int i = 1111; i <= 9999; i++)
  18. {
  19. int a = i % 10;
  20. rest = i / 10;
  21. int b = rest % 10;
  22. rest = rest / 10;
  23. int c = rest % 10;
  24. rest = rest / 10;
  25. int d = rest % 10;
  26. if (a != 0 && b != 0 && c != 0 && d != 0)
  27. {
  28. if (n % a == 0 && n % b == 0 && n % c == 0 && n % d == 0)
  29. {
  30. Console.Write("{0}{1}{2}{3} ", a, b, c, d);
  31. }
  32. }
  33.  
  34. }
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement