Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BarcodeGen_06 {
- public static void main(String[] args) {
- Scanner myScan = new Scanner(System.in);
- int numberOne = Integer.parseInt(myScan.nextLine());
- int numberTwo = Integer.parseInt(myScan.nextLine());
- int digitOne = numberOne / 1000;
- int digitTwo = numberOne / 100 % 10;
- int digitThree = numberOne / 10 % 10;
- int digitFour = numberOne % 10;
- int digitSecondOne = numberTwo / 1000;
- int digitSecondTwo = numberTwo / 100 % 10;
- int digitSecondThree = numberTwo / 10 % 10;
- int digitSecondFour = numberTwo % 10;
- for (int symbolOne = digitOne; symbolOne <= digitSecondOne; symbolOne++) {
- for (int symbolTwo = digitTwo; symbolTwo <= digitSecondTwo; symbolTwo++) {
- for (int symbolThree = digitThree; symbolThree <= digitSecondThree; symbolThree++) {
- for (int symbolFour = digitFour; symbolFour <= digitSecondFour; symbolFour++) {
- boolean check1 = symbolOne % 2 != 0;
- boolean check2 = symbolTwo % 2 != 0;
- boolean check3 = symbolThree % 2 != 0;
- boolean check4 = symbolFour % 2 != 0;
- if (check1 && check2 && check3 && check4) {
- System.out.print(symbolOne + "" + symbolTwo + "" + symbolThree + "" + symbolFour + " ");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement