desislava_topuzakova

5. вариант 2

Dec 5th, 2021
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._Winner_Tickets
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10.  
  11. for (int first = 0; first <= 9; first++)
  12. {
  13. for (int second = 0; second <= 9; second++)
  14. {
  15. for (int third = 0; third <= 9; third++)
  16. {
  17. for (int forth = 0; forth <= 9; forth++)
  18. {
  19. bool check1 = first + forth == n;
  20. bool check2 = second % 2 == 1;
  21. bool check3 = third == 4 || third == 7;
  22. if (check1 && check2 && check3)
  23. {
  24. Console.WriteLine($"{first}{second}{third}{forth} ");
  25. }
  26. }
  27. }
  28. }
  29. }
  30. }
  31. }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment