Advertisement
ggeorgiev88

pinCode

Dec 12th, 2022
64
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.     let counter = 0
  7.  
  8.     for (let x = 1; x <= firsNum; x++) {
  9.         if (x % 2 === 0) {
  10.             result += x;
  11.             for (let y = 1; y <= secondNum; y++) {
  12.                 switch (y) {
  13.                     case 2:
  14.                     case 3:
  15.                     case 5:
  16.                     case 7:
  17.                         result += y; break;
  18.                     default:
  19.                         continue;
  20.                 }
  21.                 for (let z = 1; z <= thirdNum; z++) {
  22.                     if (z % 2 === 0) {
  23.                         let endResult = result+z
  24.                         console.log(endResult);
  25.                         endResult = ""
  26.                         result =`${x}${y}`
  27.                     }
  28.                 }
  29.             }
  30.  
  31.         }
  32.  
  33.  
  34.     }
  35. }
  36.  
  37. pinCode([
  38.     "3",
  39.     "5",
  40.     "5"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement