diff options
-rw-r--r-- | error.txt | 2 | ||||
-rw-r--r-- | primes.txt | 18 |
2 files changed, 19 insertions, 1 deletions
@@ -1,3 +1,3 @@ def main(){ - print(if 1 kaas; else swag); + print(if 1 kaas; else swag; + 1); } diff --git a/primes.txt b/primes.txt new file mode 100644 index 0000000..e693345 --- /dev/null +++ b/primes.txt @@ -0,0 +1,18 @@ +def checkprime(n){ + i = 2; + s = int(sqrt(n)); + while i <= s { + if n % i == 0 break; + i += 1; + } + return(i < s); +} + +def main(argc,argv){ + N = 100; + i = 2; + while i < N { + if checkprime(i) print(i); + i += 1; + } +} |