borkins

Exam 06-Mar-2016 - 06. Stupid Password Generator

May 14th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. /**
  2.  * Project: Exam_06_March_2016 - created by borkins on 2017-05-14.
  3.  */
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class _06_StupidPasswordGenerator
  8. {
  9.     public static void main(String[] args)
  10.     {
  11.         Scanner console = new Scanner(System.in);
  12.    
  13.         int n = Integer.parseInt(console.nextLine());
  14.         int l = Integer.parseInt(console.nextLine());
  15.    
  16.         for (int i = 1; i < n; i++)
  17.         {
  18.             for (int j = 1; j < n; j++)
  19.             {
  20.                 for (char a = 'a'; a < 'a' + l; a++)
  21.                 {
  22.                     for (char b = 'a'; b < 'a' + l; b++)
  23.                     {
  24.                         for (int k = Math.max(i, j) + 1; k <= n; k++)
  25.                         {
  26.                             System.out.printf("%d%d%c%c%d ", i, j, a, b, k);
  27.                         }
  28.                     }
  29.                 }
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment