Advertisement
vencinachev

Digits1

Nov 21st, 2021
999
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             int cnt = 0;
  11.             for (int a = 1; a <= 9; a++)
  12.             {
  13.                 for (int b = 1; b <= 9; b++)
  14.                 {
  15.                     for (int c = 1; c <= 9; c++)
  16.                     {
  17.                         for (int d = 1; d <= 9; d++)
  18.                         {
  19.                             if ((a + b == n) && (c % 2 == 0) && (d == 3 || d == 6))
  20.                             {
  21.                                 cnt++;
  22.                                 Console.Write($"{a}{b}{c}{d} ");
  23.                             }
  24.                         }
  25.                     }
  26.                 }
  27.             }
  28.             Console.WriteLine($"\nCount of winner numbers: {cnt}");
  29.         }
  30.     }
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement