瀏覽代碼

add new flie js/l2.js for multiplication tables up to 100

root 1 月之前
父節點
當前提交
c179c54d66
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      js/l2.js

+ 14 - 0
js/l2.js

@@ -0,0 +1,14 @@
+const readline = require('readline').createInterface({
+  input: process.stdin,
+  output: process.stdout
+});
+
+readline.question('Число ', (answer) => {
+  let pol = Number(answer);
+  readline.close();
+  let x = 0;
+  while(x <= 100) { 
+        x = x + 1;
+        console.log(pol, '*', x, '=', pol * x);
+  }
+});