Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- int beginningInt = Integer.parseInt(scanner.nextLine());
- int endingInt = Integer.parseInt(scanner.nextLine());
- String beginning = String.valueOf(beginningInt);
- String ending = String.valueOf(endingInt);
- for (int j = Character.getNumericValue(beginning.charAt(0)); j <= Character.getNumericValue(ending.charAt(0)); j++) {
- for (int k = Character.getNumericValue(beginning.charAt(1)); k <= Character.getNumericValue(ending.charAt(1)); k++) {
- for (int l = Character.getNumericValue(beginning.charAt(2)); l <= Character.getNumericValue(ending.charAt(2)); l++) {
- for (int m = Character.getNumericValue(beginning.charAt(3)) ; m <= Character.getNumericValue(ending.charAt(3)); m++) {
- if (j % 2 != 0 && k % 2 != 0 && l % 2 != 0 && m % 2 != 0) {
- System.out.printf("%d%d%d%d ",j,k,l,m);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement