Advertisement
Spocoman

08. Secret Door's Lock

Jan 1st, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function secretDoor(input) {
  2.     let a = Number(input[0]);
  3.     let b = Number(input[1]);
  4.     let c = Number(input[2]);
  5.  
  6.     for (let i = 2; i <= a; i++) {
  7.         for (let j = 2; j <= b; j++) {
  8.             for (let x = 2; x <= c; x++) {
  9.                 if (i % 2 === 0 && x % 2 === 0 && (j === 2 || j === 3 || j === 5 || j === 7)) {
  10.                     console.log(`${i} ${j} ${x}`);
  11.                 }
  12.             }
  13.         }
  14.     }
  15. }
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement