Advertisement
veronikaaa86

06. Barcode Generator with int

Nov 9th, 2021
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int firstNum = Integer.parseInt(scanner.nextLine());
  8. int secondNum = Integer.parseInt(scanner.nextLine());
  9.  
  10. int fourthSymbolFirstNum = firstNum % 10;
  11. firstNum = firstNum / 10;
  12. int fourthSymbolSecondNum = secondNum % 10;
  13. secondNum = secondNum / 10;
  14.  
  15. int thirdSymbolFirstNum = firstNum % 10;
  16. firstNum = firstNum / 10;
  17. int thirdSymbolSecondNum = secondNum % 10;
  18. secondNum = secondNum / 10;
  19.  
  20. int secondSymbolFirstNum = firstNum % 10;
  21. firstNum = firstNum / 10;
  22. int secondSymbolSecondNum = secondNum % 10;
  23. secondNum = secondNum / 10;
  24.  
  25. int firstSymbolFirstNum = firstNum % 10;
  26. firstNum = firstNum / 10;
  27. int firstSymbolSecondNum = secondNum % 10;
  28. secondNum = secondNum / 10;
  29.  
  30. //2345
  31. //6789
  32. for (int i = firstSymbolFirstNum; i <= firstSymbolSecondNum; i++) {
  33. if (i % 2 == 0) continue;
  34. for (int j = secondSymbolFirstNum; j <= secondSymbolSecondNum; j++) {
  35. if (j % 2 == 0) continue;
  36. for (int k = thirdSymbolFirstNum; k <= thirdSymbolSecondNum; k++) {
  37. if (k % 2 == 0) continue;
  38. for (int l = fourthSymbolFirstNum; l <= fourthSymbolSecondNum; l++) {
  39. if (l % 2 == 0) continue;
  40.  
  41. System.out.printf("%d%d%d%d ", i, j, k, l);
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
  48.  
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement