Sybatron

PASSWORDS GENERATOR

Dec 3rd, 2018
511
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 TEST_Homework
  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 maxPasswords = int.Parse(Console.ReadLine());
  16.  
  17.             // bool end = false;
  18.             char A = (char)35;
  19.             char B = (char)64;
  20.             int br = 1;
  21.             for (int x = 1; x <= a; x++)
  22.             {
  23.                 for (int y = 1; y <= b; y++)
  24.                 {
  25.                     br++;
  26.                    
  27.                     Console.Write($"{A}{B}{x}{y}{B}{A}|");
  28.                     A++;
  29.                     B++;
  30.                     if (A > 55)
  31.                     {
  32.                         A = (char)35;
  33.                     }
  34.                     if (B > 96)
  35.                     {
  36.                         B = (char)64;
  37.                     }
  38.                     if (br > maxPasswords)
  39.                     {
  40.                         return;
  41.                     }
  42.                 }
  43.             }
  44.         }
  45.     }
  46. }
Add Comment
Please, Sign In to add comment