Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ProgrammingBasics.NestedLoops;
- import java.util.Scanner;
- public class SafePasswordsGenerator07 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int thirdSymbol = Integer.parseInt(scanner.nextLine());
- int fourthSymbol = Integer.parseInt(scanner.nextLine());
- int max = Integer.parseInt(scanner.nextLine());
- int a = 35;
- int b = 64;
- int counter = 0;
- for (int i = 1; i <= thirdSymbol; i++) {
- for (int j = 1; j <= fourthSymbol; j++) {
- System.out.printf("%c%c%d%d%c%c|", a, b, i, j, b, a);
- counter++;
- if (i == thirdSymbol && j == fourthSymbol || counter == max) {
- return;
- }
- a++;
- b++;
- if (a > 55) {
- a = 35;
- }
- if (b > 96) {
- b = 64;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement