Update sive.js

This commit is contained in:
Arma-Damna-Dillo 2024-10-21 21:47:03 +00:00
parent faf3952738
commit 996c3f9051

View file

@ -1,7 +1,6 @@
const readline = require("readline"); const readline = require("readline");
const { stdin: input, stdout: output } = require('node:process'); const { stdin: input, stdout: output } = require('node:process');
let primes = [] let primes = []
const isPrime = num => { const isPrime = num => {
@ -16,7 +15,6 @@ const rl = readline.createInterface({ input, output });
rl.question('Sive to: ', (siveTo) => { rl.question('Sive to: ', (siveTo) => {
siveTo = Number(siveTo) siveTo = Number(siveTo)
for (var i = 1; i < siveTo; i++) { for (var i = 1; i < siveTo; i++) {
if (isPrime(i)) { if (isPrime(i)) {
primes.push(i) primes.push(i)