Advertisement
veronikaaa86

06. Barcode Generator

Nov 9th, 2021
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1.  
  2. import java.util.*;
  3.  
  4. public class Main {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. String firstNum = scanner.nextLine();
  9. String secondNum = scanner.nextLine();
  10. //2345
  11. //6789
  12. for (int i = firstNum.charAt(0); i <= secondNum.charAt(0); i++) {
  13. for (int j = firstNum.charAt(1); j <= secondNum.charAt(1); j++) {
  14. for (int k = firstNum.charAt(2); k <= secondNum.charAt(2); k++) {
  15. for (int l = firstNum.charAt(3); l <= secondNum.charAt(3); l++) {
  16.  
  17. if (i % 2 != 0 && j % 2 != 0 && k % 2 != 0 && l % 2 != 0) {
  18. System.out.printf("%c%c%c%c ", i, j, k, l);
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26.  
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement