SHARE
TWEET

PasswordGenerator

a guest Feb 22nd, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class ExercisesPasswordGenerator {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int n = Integer.parseInt(scanner.nextLine());
  8.         int L = Integer.parseInt(scanner.nextLine());
  9.  
  10.         for (int firstSymbol = 1; firstSymbol <= n ; firstSymbol++) {
  11.             for (int secondSymbol = 1; secondSymbol <= n; secondSymbol++) {
  12.                 for (int thirdSymbol = 97; thirdSymbol <= 96+L; thirdSymbol++) {
  13.                     char thirdSymbolToChar = (char) thirdSymbol;
  14.                     for (int forthSymbol = 97; forthSymbol <= 96+L ; forthSymbol++) {
  15.                         char forthSymbolToChar = (char) forthSymbol;
  16.                         for (int fifthSymbol = 1; fifthSymbol <= firstSymbol && fifthSymbol < secondSymbol; fifthSymbol++) {
  17.                             System.out.printf("%d%d%c%c%d " , fifthSymbol , secondSymbol , thirdSymbolToChar , forthSymbolToChar , fifthSymbol);
  18.                         }
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top