Advertisement
jkonova

Untitled

Aug 11th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. using System;
  2.  
  3. namespace BarcodeGenerator
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int start = int.Parse(Console.ReadLine());
  10.             int end = int.Parse(Console.ReadLine());
  11.  
  12.             int dFirst = start % 10;
  13.             start /= 10;
  14.             int cFirst = start % 10;
  15.             start /= 10;
  16.             int bFirst = start % 10;
  17.             start /= 10;
  18.             int aFirst = start % 10;
  19.  
  20.             int dSecond = end % 10;
  21.             end /= 10;
  22.             int cSecond = end % 10;
  23.             end /= 10;
  24.             int bSecond = end % 10;
  25.             end /= 10;
  26.             int aSecond = end % 10;
  27.  
  28.             for (int a = aFirst; a <= aSecond; a++)
  29.             {
  30.                 for (int b = bFirst; b <= bSecond; b++)
  31.                 {
  32.                     for (int c = cFirst; c <= cSecond; c++)
  33.                     {
  34.                         for (int d = dFirst; d <= dSecond; d++)
  35.                         {
  36.                             if (a % 2 != 0 && b % 2 != 0 && c % 2 != 0 && d % 2 != 0)
  37.                             {
  38.                                 Console.Write($"{a}{b}{c}{d} ");
  39.                             }
  40.                         }
  41.                     }
  42.                 }
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement