nq1s788

24 с системами счисления

May 20th, 2026
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from string import printable
  2. #print(printable)
  3. s = open('24.txt').readline()
  4. S = s
  5. for c in 'FGHIJKLMNOPQRSTUVWXYZ':
  6.     s = s.replace(c, '!')
  7. s = s.split('!')
  8. a = []
  9. for e in s:
  10.     if '8' not in e:
  11.         continue
  12.     l = e.index('8')
  13.     r = max(e.rfind('8'), e.rfind('0'))
  14.     a.append(e[l:r+1])
  15. answ = '0'
  16. for e in a:
  17.     if int(e, 16) > int(answ, 16):
  18.         answ = e
  19. print(answ)
  20. print(S.find(answ))
Advertisement
Add Comment
Please, Sign In to add comment