Advertisement
nq1s788

24

Dec 17th, 2023
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. f = open('zadanie24_1.txt').readline()
  2. answ = 0 #самая длина длина которую мы нашли
  3. cur = 0 #текущая длина
  4. for i in range(len(f)):
  5.     if f[i] == 'C':
  6.         cur += 1
  7.         if cur > answ:
  8.             answ = cur
  9.     else:
  10.         cur = 0
  11. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement