Advertisement
psi_mmobile

Untitled

May 28th, 2022
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. public class MyClass {
  2.     public static void main(String args[]) {
  3.         java.util.Scanner scanner = new java.util.Scanner(System.in);
  4.         String beginning = scanner.nextLine();
  5.         String ending = scanner.nextLine();
  6.         for (int j = Character.getNumericValue(beginning.charAt(0)); j <= Character.getNumericValue(ending.charAt(0)); j++) {
  7.             for (int k = Character.getNumericValue(beginning.charAt(1)); k <= Character.getNumericValue(ending.charAt(1)); k++) {
  8.                 for (int l = Character.getNumericValue(beginning.charAt(2)); l <= Character.getNumericValue(ending.charAt(2)); l++) {
  9.                     for (int m = Character.getNumericValue(beginning.charAt(3)) ; m <= Character.getNumericValue(ending.charAt(3)); m++) {
  10.                         if (j % 2 != 0 && k % 2 != 0 && l % 2 != 0 && m % 2 != 0) {
  11.                             System.out.printf("%d%d%d%d ",j,k,l,m);
  12.                         }
  13.                     }
  14.                 }
  15.             }
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement