Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- #define pii pair<int , int>
- #define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
- #define MAXX 1005
- int ans = 1 , mx;
- string s;
- int main()
- {
- _FastIO;
- cin >> s;
- for(int i = 1; i < s.size(); i++){
- if(s[i] == s[i - 1]) ans++;//cvb artiririq
- else{
- mx = max(mx , ans);
- ans = 1; // 1eledimki ozu de sayilsin
- }
- }
- cout << max(mx , ans) << endl; //max yox max(mx , ans) umumi cavab axiurda da ola biler
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement