Vassil_Iliev

"Good" numbers

Mar 17th, 2022
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let init = +gets();
  2. let toNum = +gets();
  3. let counter = 0;
  4.  
  5. outer:
  6. for (let i = init; i <= toNum; i++) {
  7.     let divisors = String(i);
  8.  
  9.     for (let j = 0; j < divisors.length; j++) {
  10.  
  11.         if (i % +divisors[j] !== 0 && +divisors[j] !== 0) {
  12.             continue outer;
  13.         }
  14.     }
  15.     counter++
  16. }
  17. print(counter)
Advertisement
Add Comment
Please, Sign In to add comment