Rosen_Tenev

Untitled

Dec 2nd, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.60 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 _06.Safe_password_Gen
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int a = int.Parse(Console.ReadLine());
  14.             int b = int.Parse(Console.ReadLine());
  15.             int numPass = int.Parse(Console.ReadLine());
  16.             int counter = 0;
  17.  
  18.             for (int A = (char)'#'; A <= (char)'7'; A++)
  19.             {
  20.                 for (int B = (char)'@'; B <= (char)'`'; B++)
  21.                 {
  22.                     for (int x = 1; x <= a; x++)
  23.                     {
  24.                         for (int y = 1; y <= b; y++)
  25.                         {
  26.                             if (A > 55)
  27.                             {
  28.                                 A = 35;
  29.                             }
  30.                             if (B > 96)
  31.                             {
  32.                                 B = 64;
  33.                             }
  34.  
  35.                             counter++;
  36.  
  37.                             if (counter <= numPass)
  38.                             {
  39.                                 Console.Write($"{(char)A}{(char)B}{x}{y}{(char)B}{(char)A}|");
  40.                                 A++;
  41.                                 B++;
  42.                                 if (x == a && y == b)
  43.                                 {
  44.                                     return;
  45.                                 }
  46.                             }
  47.                         }
  48.                     }
  49.                 }
  50.             }
  51.  
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment