Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const getGets = (arr) => {
  2.     let index = 0;
  3.  
  4.     return () => {
  5.         const toReturn = arr[index];
  6.         index += 1;
  7.         return toReturn;
  8.     };
  9. };
  10. // this is the test
  11. const test = [
  12.     '13',
  13.    
  14. ];  
  15.  
  16. const gets = this.gets || getGets(test);
  17. const print = this.print || console.log;
  18.  
  19.  let input = gets()
  20.  let number =0
  21.  for (let i = 0 ; i < input ; i++) {
  22.  if (input%i === 0 || input%(i+2) === 0) {
  23.  number += i
  24.  print(number)
  25.  }
  26.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement