Advertisement
aggressiveviking

Untitled

Feb 19th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _07.SafePasswordsGenerator
  4. {
  5.     class SafePasswordsGenerator
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int a = int.Parse(Console.ReadLine());
  10.             int b = int.Parse(Console.ReadLine());
  11.             int max = int.Parse(Console.ReadLine());
  12.            
  13.             int counter = 0;
  14.             int i = 35;
  15.             int j = 64;
  16.  
  17.             while (i <= 55)
  18.             {
  19.                 while (j <= 96)
  20.                 {
  21.                     for (int k = 1; k <= a; k++)
  22.                     {
  23.                         for (int l = 1; l <= b; l++)
  24.                         {
  25.                             char one = ((char)i);
  26.                             char two = ((char)j);
  27.  
  28.                             Console.Write($"{one}{two}{k}{l}{two}{one}|");
  29.                            
  30.                             counter += 1;
  31.                             i++;
  32.                             j++;
  33.  
  34.                             if (counter >= max || k == a && l == b)
  35.                             {
  36.                                 return;
  37.                             }
  38.                             if (i > 55)
  39.  
  40.                             {
  41.                                 i = 35;
  42.                             }
  43.                             if (j > 96)
  44.                             {
  45.                                 j = 64;
  46.                             }
  47.                         }
  48.  
  49.                     }
  50.  
  51.                 }
  52.  
  53.             }
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement