simonradev

StupidPasswordGenerator

Mar 12th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 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 StupidPasswordGenerator
  8. {
  9.     class StupidPasswordGenerator
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             int L = int.Parse(Console.ReadLine());
  15.            
  16.             for (int firstNum = 1; firstNum < n; firstNum++)
  17.             {
  18.                 for (int secondNum = 1; secondNum < n; secondNum++)
  19.                 {
  20.                     for (char firstLetter = 'a'; firstLetter < 'a' + L; firstLetter++)
  21.                     {
  22.                         for (char secondLetter = 'a'; secondLetter < 'a' + L; secondLetter++)
  23.                         {
  24.                             for (int lastNum = Math.Max(firstNum, secondNum) + 1; lastNum <= n; lastNum++)
  25.                             {
  26.                                 Console.Write($"{firstNum}{secondNum}{firstLetter}{secondLetter}{lastNum} ");
  27.                             }
  28.                         }
  29.                     }
  30.                 }
  31.             }
  32.         }
  33.     }
  34. }
Add Comment
Please, Sign In to add comment