Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package examPrep;
- import java.util.Scanner;
- public class P06BarcodeGenerator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String first = scanner.nextLine();
- String second = scanner.nextLine();
- //2345
- //6789
- for (int i = first.charAt(0); i <= second.charAt(0); i++) {
- if (i % 2 == 0) continue;
- for (int j = first.charAt(1); j <= second.charAt(1); j++) {
- if (j % 2 == 0) continue;
- for (int k = first.charAt(2); k <= second.charAt(2); k++) {
- if (k % 2 == 0) continue;
- for (int l = first.charAt(3); l <= second.charAt(3); l++) {
- if (l % 2 == 0) continue;
- System.out.printf("%c%c%c%c ", i, j, k, l);
- // if (i % 2 != 0 &&
- // j % 2 != 0 &&
- // k % 2 != 0 &&
- // l % 2 != 0) {
- // System.out.printf("%c%c%c%c ", i, j, k, l);
- // }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement