Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SafePasswordsGenerator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int a = Integer.parseInt(scanner.nextLine()),
- b = Integer.parseInt(scanner.nextLine()),
- passCount = Integer.parseInt(scanner.nextLine()),
- charA = 35, charB = 64;
- for (int j = 1; j <= a; j++) {
- for (int x = 1; x <= b; x++) {
- if (charA == 56) {
- charA = 35;
- }
- if (charB == 97) {
- charB = 64;
- }
- System.out.printf("%c%c%d%d%c%c|", charA, charB, j, x, charB, charA);
- passCount--;
- charA++;
- charB++;
- if (passCount == 0) {
- break;
- }
- }
- if (passCount == 0) {
- break;
- }
- }
- }
- }
- ИЛИ:
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int a = Integer.parseInt(scanner.nextLine()),
- b = Integer.parseInt(scanner.nextLine()),
- passCount = Integer.parseInt(scanner.nextLine()),
- charA = 35, charB = 64;
- for (int j = 1; j <= a; j++) {
- for (int x = 1; x <= b; x++) {
- if (charA == 56) {
- charA = 35;
- }
- if (charB == 97) {
- charB = 64;
- }
- System.out.printf("%c%c%d%d%c%c|", charA, charB, j, x, charB, charA);
- passCount--;
- charA++;
- charB++;
- if (passCount == 0) {
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement