Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int firstNum = Integer.parseInt(scanner.nextLine());
- int secondNum = Integer.parseInt(scanner.nextLine());
- int fourthSymbolFirstNum = firstNum % 10;
- firstNum = firstNum / 10;
- int fourthSymbolSecondNum = secondNum % 10;
- secondNum = secondNum / 10;
- int thirdSymbolFirstNum = firstNum % 10;
- firstNum = firstNum / 10;
- int thirdSymbolSecondNum = secondNum % 10;
- secondNum = secondNum / 10;
- int secondSymbolFirstNum = firstNum % 10;
- firstNum = firstNum / 10;
- int secondSymbolSecondNum = secondNum % 10;
- secondNum = secondNum / 10;
- int firstSymbolFirstNum = firstNum % 10;
- firstNum = firstNum / 10;
- int firstSymbolSecondNum = secondNum % 10;
- secondNum = secondNum / 10;
- //2345
- //6789
- for (int i = firstSymbolFirstNum; i <= firstSymbolSecondNum; i++) {
- if (i % 2 == 0) continue;
- for (int j = secondSymbolFirstNum; j <= secondSymbolSecondNum; j++) {
- if (j % 2 == 0) continue;
- for (int k = thirdSymbolFirstNum; k <= thirdSymbolSecondNum; k++) {
- if (k % 2 == 0) continue;
- for (int l = fourthSymbolFirstNum; l <= fourthSymbolSecondNum; l++) {
- if (l % 2 == 0) continue;
- System.out.printf("%d%d%d%d ", i, j, k, l);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement