Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Winner_Tickets
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for (int first = 0; first <= 9; first++)
- {
- for (int second = 0; second <= 9; second++)
- {
- for (int third = 0; third <= 9; third++)
- {
- for (int forth = 0; forth <= 9; forth++)
- {
- bool check1 = first + forth == n;
- bool check2 = second % 2 == 1;
- bool check3 = third == 4 || third == 7;
- if (check1 && check2 && check3)
- {
- Console.WriteLine($"{first}{second}{third}{forth} ");
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment