Advertisement
Spocoman

04. Car Number

Sep 12th, 2023
929
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int startNum, finalNum;
  7.     cin >> startNum >> finalNum;
  8.  
  9.     for (int i = startNum; i <= finalNum; i++) {
  10.         for (int k = startNum; k <= finalNum; k++) {
  11.             for (int j = startNum; j <= finalNum; j++) {
  12.                 for (int x = startNum; x <= finalNum; x++) {
  13.                     if ((i % 2 == 0 && x % 2 == 1 || i % 2 == 1 && x % 2 == 0)
  14.                         && i > x && (k + j) % 2 == 0) {
  15.                         cout << i << k << j << x << " ";
  16.                     }
  17.                 }
  18.             }
  19.         }
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement