Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CarNumber {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int startNum = Integer.parseInt(scanner.nextLine());
- int finalNum = Integer.parseInt(scanner.nextLine());
- for (int i = startNum; i <= finalNum; i++) {
- for (int k = startNum; k <= finalNum; k++) {
- for (int j = startNum; j <= finalNum; j++) {
- for (int x = startNum; x <= finalNum; x++) {
- if ((i % 2 == 0 && x % 2 == 1 || i % 2 == 1 && x % 2 == 0)
- && i > x && (k + j) % 2 == 0) {
- System.out.printf("%d%d%d%d ", i, k, j, x);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement