SHARE
TWEET

Untitled

gamezovladislav Dec 10th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sum(x) {
  2.     return x.toString()
  3.         .split('')
  4.         .reduce(function (a, b) {
  5.             return +a + +b;
  6.         });
  7. }
  8.  
  9. function foo(delta) {
  10.     for (var i = 100; i <= 999; i+=delta) {
  11.         var tmp = "";
  12.         for (var j = 0; j < delta; j++) {
  13.             var tmpValue = i + j;
  14.             tmp += (tmpValue + "\t-->\t" + (27 * sum(tmpValue)) + "\t|" + (sum(tmpValue) * 27 === tmpValue ? "  Число подходит" : ""));
  15.             if (j !== delta - 1) {
  16.                 tmp += "\t";
  17.             }
  18.         }
  19.         console.log(tmp);
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top