dakata450

Untitled

Jul 23rd, 2022
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BarcodeGenerator {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int num1 = Integer.parseInt(scanner.nextLine());
  8. int num2 = Integer.parseInt(scanner.nextLine());
  9.  
  10. int f1 = num1 / 1000;
  11. int f2 = num1 / 100 % 10;
  12. int f3 = num1 / 10 % 10;
  13. int f4 = num1 % 10;
  14.  
  15. int s1 = num2 / 1000;
  16. int s2 = num2 / 100 % 10;
  17. int s3 = num2 / 10 % 10;
  18. int s4 = num2 % 10;
  19.  
  20. for (int i = 1; i <= 9; i++) {
  21. for (int j = 1; j <= 9; j++) {
  22. for (int k = 1; k <= 9; k++) {
  23. for (int l = 1; l <= 9; l++) {
  24. if ((i % 2 == 0 || i == 1) && i >= num1 && i <= num2) {
  25. if ((j % 2 == 0 || j == 1) && j >= num1 && j <= num2) {
  26. if ((k % 2 == 0 || k == 1) && k >= num1 && k <= num2) {
  27. if ((l % 2 == 0 || l == 1) && l >= num1 && l <= num2) {
  28. System.out.printf("%d%d%d%d", i, j, k, l);
  29. }
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment