Skip to content
Snippets Groups Projects
Select Git revision
  • 0112bbacff866f6c8004745ec3af4134653627b6
  • master default
  • zs2021
  • zs1920
4 results

sito.py

Blame
  • sito.py 229 B
    #!/usr/bin/env python3
    # Eratosthenovo síto: najde prvočísla mezi 1 a N
    
    N = int(input())
    A = [True] * (N+1)
    
    for i in range(2, N+1):
        if A[i]:
            print(i)
            for j in range(2*i, N+1, i):
                A[j] = False