Advertisement
Guest User

Untitled

a guest
Jul 5th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Bank
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             int a = int.Parse(Console.ReadLine());
  11.             int origA = a;
  12.             char b = char.Parse(Console.ReadLine());
  13.             char origB = b;
  14.             char c = char.Parse(Console.ReadLine());
  15.             char origC = c;
  16.             char d = char.Parse(Console.ReadLine());
  17.             char origD = d;
  18.             int e = int.Parse(Console.ReadLine());
  19.             int origE = e;
  20.  
  21.             int maxValidNumbers = int.Parse(Console.ReadLine());
  22.  
  23.            
  24.             while (true)
  25.             {
  26.                 if (a % 10 == 2 && e % 10 == 5)
  27.                 {
  28.                    
  29.                     maxValidNumbers--;
  30.                     if (maxValidNumbers <= 0) {
  31.                         break;
  32.                     }
  33.                 }
  34.  
  35.                 e--;
  36.                 if(e < 10)
  37.                 {
  38.                     e = origE;
  39.                     d++;
  40.                 }
  41.  
  42.                 if (d > 'Z')
  43.                 {
  44.                     d = origD;
  45.                     c++;
  46.                 }
  47.  
  48.                 if (c > 'z')
  49.                 {
  50.                     c = origC;
  51.                     b++;
  52.                 }
  53.  
  54.                 if (b > 'Z')
  55.                 {
  56.                     b = origB;
  57.                     a++;
  58.                 }
  59.  
  60.                 if (a > 99)
  61.                 {
  62.                     a = origA;
  63.                 }
  64.  
  65.             }
  66.             Console.WriteLine($"{a}{b}{c}{d}{e}");
  67.  
  68.         }
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement