Advertisement
nq1s788

чередование согл+гласн

Dec 20th, 2023
885
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. f = open('24.txt').readline()
  2. answ = 0
  3. cur = 0
  4. s = ['CDF', 'AO']
  5. for i in range(len(f)):
  6.     if f[i] in s[cur % 2]:
  7.         cur += 1
  8.         if cur > answ:
  9.             answ = cur
  10.     else:
  11.         cur = 0
  12. print(answ)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement