sang nguyen to python

Solutions on MaxInterview for sang nguyen to python by the best coders in the world

showing results for - "sang nguyen to python"
Vanessa
06 Aug 2018
1#Cach 1: Sang true false
2prime = [True] * (n+1)
3prime[0] = prime[1] = False
4for i in range(2, n+1):
5  if prime[i]:
6    for j in range(i*i, n+1, i):
7      prime[j] = False
8
9
10#Cach 2: Sang ra so
11prime = []
12m = []
13for i in range(2, n+1):
14  if i not in m:
15    prime.append(i)
16    for j in range(i*i, n+1, i):
17      m.append(j)
18
queries leading to this page
sang nguyen to pythonsang nguyen to python