Arkanium77

Untitled

Feb 16th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. n=input()
  2. n=n.split()
  3. n=list(map(int, n))
  4. a=set(n)
  5. m=[[i] for i in a]
  6. t=0
  7. for i in a:
  8.     m[t].append(n.count(i))
  9.     t+=1
  10.    
  11. maxi=0
  12. for i in m:
  13.     if i[1]>maxi:
  14.         maxi=i[1]
  15. for i in m:
  16.     if i[1]==maxi:
  17.         print ("Самый часто встречающийся элемент - %s. Он встречается %s раз"%(i[0],i[1]))
Advertisement
Add Comment
Please, Sign In to add comment