Advertisement
desislava_topuzakova

Untitled

Mar 3rd, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class eLexam06_SafePasswordsGenerator {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int aX = Integer.parseInt(scanner.nextLine());
  7. int bY = Integer.parseInt(scanner.nextLine());
  8. int maxNumberPass = Integer.parseInt(scanner.nextLine());
  9. int A = 35;
  10. int B = 64;
  11. int counter = 0;
  12.  
  13. for (int j = 1; j <= aX; j++) {
  14. for (int k = 1; k <= bY; k++) {
  15.  
  16. counter++;
  17. if (counter > maxNumberPass) {
  18. break;
  19. }
  20.  
  21. System.out.print((char) A);
  22. System.out.print((char) B);
  23. System.out.print(j);
  24. System.out.print(k);
  25. System.out.print((char) B);
  26. System.out.print((char) A);
  27. System.out.print("|");
  28.  
  29. if (A >= 55) {
  30. A = 35;
  31. } else {
  32. A++;
  33. }
  34.  
  35. if (B >= 96) {
  36. B = 64;
  37. } else {
  38. B++;
  39. }
  40. }
  41. }
  42. }
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement