Advertisement
ggeorgiev88

pinCode

Dec 13th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function pinCode(input) {
  2.     let firsNum = Number(input[0]);
  3.     let secondNum = Number(input[1]);
  4.     let thirdNum = Number(input[2]);
  5.     let result = ""
  6.  
  7.     for (let x = 1; x <= firsNum; x++) {
  8.         if (x % 2 === 0) {
  9.             for (let y = 1; y <= secondNum; y++) {
  10.                 switch (y) {
  11.                     case 2:
  12.                     case 3:
  13.                     case 5:
  14.                     case 7: ; break;
  15.                     default:
  16.                         continue;
  17.                 }
  18.                 for (let z = 1; z <= thirdNum; z++) {
  19.                     if (z % 2 === 0) {
  20.                         result = `${x}${y}${z}`
  21.                         console.log(result);
  22.                     }
  23.                 }
  24.             }
  25.         }
  26.     }
  27. }
  28.  
  29. pinCode([
  30.     "8",
  31.     "2",
  32.     "8"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement