AlexTasev

BankNumberGenerator

Apr 28th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _6_BankNumberGenerator
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int a = int.Parse(Console.ReadLine());
  10.             char b = char.Parse(Console.ReadLine());
  11.             char c = char.Parse(Console.ReadLine());
  12.             char d = char.Parse(Console.ReadLine());
  13.             int e = int.Parse(Console.ReadLine());
  14.             int N = int.Parse(Console.ReadLine());
  15.  
  16.             int counter = 0;
  17.  
  18.             for (int i = a; i <= 99; i++)
  19.             {
  20.                 for (char j = b; j <= 'Z'; j++)
  21.                 {
  22.                     for (char k = c; k <= 'z'; k++)
  23.                     {
  24.                         for (char l = d; l <= 'Z'; l++)
  25.                         {
  26.                             for (int m = e; m >= 10; m--)
  27.                             {
  28.                                 if (i % 10 == 2 && m % 10 == 5)
  29.                                 {
  30.                                     counter++;
  31.  
  32.                                     if (counter == N)
  33.                                     {
  34.                                         Console.WriteLine($"{i}{j}{k}{l}{m}");
  35.                                         return;
  36.                                     }
  37.                                 }
  38.                             }
  39.                         }
  40.                     }
  41.                 }
  42.             }
  43.         }
  44.     }
  45. }
Add Comment
Please, Sign In to add comment