daily pastebin goal
54%
SHARE
TWEET

Untitled

a guest Dec 13th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Напишите программу, которая удаляет из массива все простые числа, встречающиеся больше одного раза.
  2. m = int(input())
  3. B = []
  4. A = [0 for i in range(m)]
  5. for i in range(m):
  6.     A[i] = int(input())
  7. for i in range(m):
  8.     if A[i] <= 1:
  9.         B.append(A[i])
  10.     else:
  11.         k = 0
  12.         for j in range(2, (A[i] // 2)+1):
  13.             if A[i] % j == 0:
  14.                 k = k + 1
  15.             else:
  16.                 k = k
  17.         if k >= 1:
  18.             B.append(A[i])
  19.         else:
  20.             h = 0
  21.             for g in range(1, m):
  22.                 if A[i] == A[g]:
  23.                     l = l + 1
  24.                 else:
  25.                     l = l
  26.             if l >= 2:
  27.                 B = B
  28.             else:
  29.                 B.append(A[i])
  30. print(B)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top