Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function carNumbers(input) {
- let startNum = Number(input[0]);
- let finalNum = Number(input[1]);
- let print = '';
- for (let i = startNum; i <= finalNum; i++) {
- for (let k = startNum; k <= finalNum; k++) {
- for (let j = startNum; j <= finalNum; j++) {
- for (let x = startNum; x <= finalNum; x++) {
- if ((i % 2 === 0 && x % 2 === 1 || i % 2 === 1 && x % 2 === 0)
- && i > x && (k + j) % 2 === 0) {
- print += `${i}${k}${j}${x} `;
- }
- }
- }
- }
- }
- console.log(print);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement