Advertisement
SophiYo

O6SafePassGenerator

Dec 16th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. package DecemberFirst;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class O6SafePassGenerator {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int a = Integer.parseInt(scanner.nextLine());
  10.         int b = Integer.parseInt(scanner.nextLine());
  11.         int max = Integer.parseInt(scanner.nextLine());
  12.  
  13.         int counter = 0;
  14.  
  15.         for (char i = 35; i <=127 ; i++) {
  16.             for (char j = 64; j <=127 ; j++) {
  17.                 for (int k = 1; k <= a ; k++) {
  18.                     for (int l = 1; l <= b ; l++) {
  19.                      
  20.                             if (i>55) {
  21.                                 i = 35;
  22.                             }
  23.                             if (j > 96) {
  24.                                 j = 64;
  25.                             }
  26.  
  27.                             System.out.printf("%s%s%d%d%s%s|", i, j, k, l, j, i);
  28.                             counter++;
  29.                             i++;
  30.                             j++;
  31.                        
  32.                         if (counter==max || (k== a && l == b)) {
  33.                             return;
  34.                         }
  35.  
  36.                     }
  37.                 }
  38.             }
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement