SSS_Krut

Задача 836(PythonEdV2)

Aug 4th, 2021
638
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Len = int(input())
  2. mas = map(int, input().split())
  3. mas = list(mas)
  4. def F(n):
  5.     t=n
  6.     s=""
  7.     while(n>0):
  8.         s +=str(n%8)
  9.         n//=8
  10.     if(int(s[2])%2==1 and t%2==0):
  11.         return True
  12.     else:
  13.         return False
  14. mas2=[]
  15. for i in mas:
  16.     if F(i):
  17.         mas2.append(i)
  18. mas2.sort()
  19. print(len(mas2))
  20. for i in mas2:
  21.     print(i,end=" ")
RAW Paste Data