Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions 22_list_only_doubles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@
может быть произвольным

# put your python code here
s = [ int(i) for i in input().split()]
t = []
s.sort()
l = len(s)-1
k = 100000
if len(s)!=1:
for i in range(0,l):
if s[i]==s[i+1] and s[i]!=k:
t.append(s[i])
k=s[i]
for j in range(l,l+1):
if s[-1]==s[-2] and s[j]!=k:
t.append(s[j])
n = len(t)
for g in range(0,n):
print(t[g],end=' ')
s=[int(i) for i in input().split()]
i, j = 0, 0
j=0
n=[]
for st in s:
if i!=s.index(st) and st not in n:
n.append(st)
i+=1
n.sort()
for st2 in n:
print (str(n[j])+' ', end='')
j+=1