Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function test(input) {
- let n = Number(input.shift());
- let result = "";
- for (let num1 = 1; num1 <= 9; num1++) {
- for (let num2 = 1; num2 <= 9; num2++) {
- for (let num3 = 1; num3 <= 9; num3++) {
- for (let num4 = 1; num4 <= 9; num4++) {
- if(n % num1 === 0 && n%num2 ===0 && n%num3 ===0 && n%num4 === 0){
- result += (`${num1}${num2}${num3}${num4} `);
- }
- }
- }
- }
- }
- console.log(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement