fork download
  1. #include <iostream>
  2. #include<cstring>
  3. using namespace std;
  4. int main(){
  5. string s;
  6. cin>>s;
  7. long int high = -1,check = 0;
  8. for(int i = 0;i<s.length()-1;i++)
  9. {
  10. if(s[i]==s[i+1])
  11. check++;
  12. else
  13. if(check>high){
  14. high = check;
  15. check = 0;
  16. }
  17. }
  18.  
  19. cout<<high+1<<endl;
  20. }
Success #stdin #stdout 0s 4632KB
stdin
ATTCGGGA
stdout
3