sobakasutulaya

Untitled

Apr 6th, 2021
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. s = input()
  2. k = 0
  3. kmax = 0
  4. for i in range(len(s)):
  5. if ((k % 2 == 0) and (s[i] == 'C')) or ((k % 2 == 1) and (s[i] == 'A')):
  6. k += 1
  7. if kmax < k:
  8. kmax = k
  9. else:
  10. k = 0
  11. print(kmax)
Add Comment
Please, Sign In to add comment