desislava_topuzakova

05. Password Generator

Nov 8th, 2020
2,915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner (System.in);
  6.        int n = Integer.parseInt(scanner.nextLine());
  7.        int l = Integer.parseInt(scanner.nextLine());
  8.  
  9.        //{}{}{}{}{}
  10.         for (int first = 1; first <= n ; first++) {
  11.             for (int second = 1; second <= n ; second++) {
  12.                 for (char third = 'a'; third < 'a' + l ; third++) {
  13.                     for (char forth = 'a'; forth < 'a' + l; forth++) {
  14.                         for (int fifth = 1; fifth <= n ; fifth++) {
  15.                             if(fifth > first && fifth > second) {
  16.                                 System.out.printf("%d%d%c%c%d ",first, second, third, forth, fifth);
  17.                             }
  18.                         }
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment