peterbodlev

BankAccauntGenerator

Jun 6th, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BankAccauntGenerator {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int a = Integer.parseInt(scanner.nextLine());
  8.         char b = scanner.nextLine().charAt(0);
  9.         char c = scanner.nextLine().charAt(0);
  10.         char d = scanner.nextLine().charAt(0);
  11.         int e = Integer.parseInt(scanner.nextLine());
  12.         int n = Integer.parseInt(scanner.nextLine());
  13.  
  14.         String pass = "";
  15.         int i = 0;
  16.  
  17.         for (int first = a; first <= 99; first++) {
  18.             for (int second = e; second > 10; second--) {
  19.                 if (first % 10 == 2 && second % 10 == 5) {
  20.                     i++;
  21.                     for (char third = b; third <= 'Z'; third++) {
  22.                         i++;
  23.                         for (char fourth = c; fourth <= 'z'; fourth++) {
  24.                             i++;
  25.                             for (char fifth = d; fifth <= 'Z'; fifth++) {
  26.                                 i++;
  27.                                 pass = "" + first + third + fourth + fifth + second;
  28.                                 if (i == n) {
  29.                                     System.out.println(pass);
  30.                                     break;
  31.                                 }
  32.                             }
  33.                         }
  34.                     }
  35.                 }
  36.             }
  37.         }
  38.     }
  39. }
Add Comment
Please, Sign In to add comment