Virtual_Universe

Решето Эратосфена

Jun 5th, 2016
202
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from math import sqrt
  2.  
  3. n = int(input())
  4. a = [True]*n
  5.  
  6. for i in range(2,int(sqrt(n))+1):
  7.     for j in range(i*2,n,i):
  8.         a[j] = False
  9. for i in range(n):
  10.     if a[i]: print(i,end = ", ")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×