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