SHARE
TWEET

Untitled

a guest Mar 26th, 2020 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  long long res, i, R, L, x;
  6.  
  7.  string a;
  8.  
  9.  
  10.  int main(){
  11.     cin>>a;
  12.     res=0;
  13.     for(i=0; i<a.length(); i++){
  14.         if(a[i]=='k')x++;
  15.         if(a[i]=='p'){
  16.             if(x>=res)res=x;
  17.             x=0;
  18.         }
  19.  
  20.         }
  21.         cout<<res;
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top