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());
- //{цифра на хилядните}{цифра на стотиците}{цифра на десетици}{цифра на единици}
- //всички числа от 1111 до 9999 -> проверка дали е печеливш -> принтираме
- for (int hil = 0; hil <= 9; hil++)
- {
- for (int stot = 0; stot <= 9; stot++)
- {
- for (int des = 0; des <= 9; des++)
- {
- for (int ed = 0; ed <= 9; ed++)
- {
- if (hil + ed == n && stot % 2 == 1 && (des == 4 || des == 7))
- {
- Console.WriteLine($"{hil}{stot}{des}{ed} ");
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment