Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.26 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_PasswordGenerator
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int num1 = int.Parse(Console.ReadLine());
  14.             int num2 = int.Parse(Console.ReadLine());
  15.             int passCount = int.Parse(Console.ReadLine());
  16.             char A1 = '#';
  17.             char B1 = '@';
  18.             char B2 = '@';
  19.             char A2 = '#';
  20.             int passwords = 0;
  21.             for (int k = 1; k <= num1; k++)
  22.             {
  23.                 for (int l = 1; l <= num2; l++)
  24.                 {
  25.                     if (passwords == passCount)
  26.                     {
  27.                         break;
  28.                     }
  29.                     if (A1 > '7' || A2 > '7')
  30.                     {
  31.                         A1 = '#';
  32.                         A2 = '#';
  33.                     }
  34.                     if (B1 > '`' || B1 > '`')
  35.                     {
  36.                         B1 = '@';
  37.                         B2 = '@';
  38.                     }
  39.                     Console.Write($"{A1++}{B1++}{k}{l}{B2++}{A2++}|");
  40.                     passwords++;
  41.                 }
  42.             }
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement