Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. using System;
  2.  
  3. namespace forDouble10SpecialNumbers
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10.  
  11. int firstNumber = 0;
  12. int secondNumber = 0;
  13. int thurthNumber = 0;
  14. int fourthNumber = 0;
  15.  
  16. int one = 0;
  17. int two = 0;
  18. int tree = 0;
  19. int four = 0;
  20.  
  21. for (int first = 1; first <= n && first <= 9; first++)
  22. {
  23. if (n % first == 0)
  24. {
  25. firstNumber = first;
  26. }
  27. for (int second = 1; second <= n && second <= 9; second++)
  28. {
  29. if (n % second == 0)
  30. {
  31. secondNumber = second;
  32. }
  33. for (int thurth = 1; thurth <= n && thurth <=9; thurth++)
  34. {
  35. if (n % thurth == 0)
  36. {
  37. thurthNumber = thurth;
  38. }
  39. for (int fourth = 1; fourth <= n && fourth <= 9; fourth++)
  40. {
  41. if (n % fourth == 0)
  42. {
  43. fourthNumber = fourth;
  44. }
  45.  
  46. if (firstNumber != one || secondNumber != two || thurthNumber != tree || fourthNumber != four)
  47. {
  48. Console.Write($" {firstNumber}{secondNumber}{thurthNumber}{fourthNumber}");
  49.  
  50. one = firstNumber;
  51. two = secondNumber;
  52. tree = thurthNumber;
  53. four = fourthNumber;
  54.  
  55. }
  56. }
  57. }
  58.  
  59. }
  60.  
  61. }
  62. }
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement