Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package SelfTestExams.DecemberExam2018;
- import java.util.Scanner;
- public class PasswordGenerator {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int a = Integer.parseInt(scan.nextLine());
- int b = Integer.parseInt(scan.nextLine());
- int total = Integer.parseInt(scan.nextLine());
- char aA = 35;
- char bB = 64;
- int count = 1;
- for (int i = 1; i <= a; i++) {
- for (int j = 1; j <= b; j++) {
- if (count > total) {
- return;
- }
- System.out.printf("%c%c%d%d%c%c|", aA, bB, i, j, bB, aA);
- aA++;
- bB++;
- count++;
- if (aA > 55) {
- aA = 35;
- }
- if (bB > 96) {
- bB = 64;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment