Advertisement
veronikaaa86

06. Barcode Generator wtih Continue

Nov 9th, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 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. String firstNum = scanner.nextLine();
  8. String secondNum = scanner.nextLine();
  9. //2345
  10. //6789
  11. for (int i = firstNum.charAt(0); i <= secondNum.charAt(0); i++) {
  12. if (i % 2 == 0) continue;
  13. for (int j = firstNum.charAt(1); j <= secondNum.charAt(1); j++) {
  14. if (j % 2 == 0) continue;
  15. for (int k = firstNum.charAt(2); k <= secondNum.charAt(2); k++) {
  16. if (k % 2 == 0) continue;
  17. for (int l = firstNum.charAt(3); l <= secondNum.charAt(3); l++) {
  18. if (l % 2 == 0) continue;
  19.  
  20. System.out.printf("%c%c%c%c ", i, j, k, l);
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement