22 lines
345 B
Python
22 lines
345 B
Python
n = int(input("Введите количество простых чисел: "))
|
|
|
|
count = 0
|
|
num = 2
|
|
|
|
while count < n:
|
|
is_prime = True
|
|
|
|
|
|
for i in range(2, num):
|
|
if num % i == 0:
|
|
is_prime = False
|
|
break
|
|
|
|
if is_prime:
|
|
print(num, end=" ")
|
|
count += 1
|
|
|
|
num += 1
|
|
|
|
print()
|