Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- freopen("input.txt", "r", stdin);
- string s;
- cin >> s;
- int k = 0, mx = 0;
- for (int i = 0; i < s.size() - 1; ) {
- if (s[i] >= 'A' && s[i] <= 'C' && s[i + 1] >= '1' && s[i + 1] <= '3') {
- k++;
- i += 2;
- continue;
- } else {
- mx = max(k, mx);
- k = 0;
- }
- i++;
- }
- cout << mx;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement