skipter

Stupid Password Generator - Java Loops Basics

Apr 29th, 2017
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class FOX {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner input = new Scanner(System.in);
  7.  
  8.         int n = Integer.parseInt(input.nextLine());
  9.         int l = Integer.parseInt(input.nextLine());
  10.  
  11.         for (int i = 1 ; i <= n; i++) {
  12.             for (int j = 1; j <= n; j++) {
  13.                 for (char k = 'a'; k < 'a' + l; k++) {
  14.                     for (char m = 'a'; m < 'a' + l; m++) {
  15.                         for (int o = (i + 1 & j + 1); o <= n ; o++) {
  16.                             if (o > i & o > j) {
  17.                                 System.out.printf("%s%s%s%s%s ", i, j, k, m, o);
  18.                             }
  19.                         }
  20.                     }
  21.                 }
  22.             }
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment