TheBulgarianWolf

Dumb password generator

Mar 14th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main
  3. {
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.         System.out.print("Enter n: ");
  7.         int n = Integer.parseInt(sc.nextLine());
  8.         System.out.print("Enter l: ");
  9.         int l = Integer.parseInt(sc.nextLine());
  10.        
  11.         for(int d1 = 1;d1<=n;d1++){
  12.             for(int d2 = 1;d2 <= n;d2++){
  13.                 for(char l1 = 'a';l1 < 'a' + l;l1++){
  14.                     for(char l2 = 'a';l2 < 'a' + l;l2++){
  15.                         for(int d3 = Math.max(d1,d2)+1;d3<=n;d3++){
  16.                             System.out.print(String.format("%d%d%c%c%d",d1,d2,l1,l2,d3));
  17.                             System.out.println();
  18.                         }
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.        
  24.     }
  25. }
Add Comment
Please, Sign In to add comment