mark79

Safe Passwords Generator

Dec 3rd, 2018
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 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 Safe_Passwords_Generator
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int a = int.Parse(Console.ReadLine());
  15.             int b = int.Parse(Console.ReadLine());
  16.             int allowedPasswordCombination = int.Parse(Console.ReadLine());
  17.  
  18.             int symbolA = 35;
  19.             int symbolB = 64;
  20.             for (int x = 1; x <= a; x++)
  21.             {
  22.                 for (int y = 1; y <= b; y++, symbolA++, symbolB++, allowedPasswordCombination--)
  23.                 {
  24.                     if (symbolA > 55)
  25.                     {
  26.                         symbolA = 35;
  27.                     }
  28.                     if (symbolB > 96)
  29.                     {
  30.                         symbolB = 64;
  31.                     }
  32.  
  33.                     if (allowedPasswordCombination == 0)
  34.                     {
  35.                         return;
  36.                     }
  37.  
  38.                     Console.Write($"{(char)symbolA}{(char)symbolB}{x}{y}{(char)symbolB}{(char)symbolA}|");
  39.                 }
  40.             }
  41.  
  42.         }
  43.     }
  44. }
Add Comment
Please, Sign In to add comment