Sim0o0na

06. Bank Number Generator

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