Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- string st; int count=0,i;
- bool f=false;
- cin >> st;//cout << st.size();
- fo(i,st.size()-1)
- {
- // cout << "1";
- if ((st[i]=='V') && (st[i+1]=='K')) count ++ ;
- if (!f)
- if (((st[i] == 'V') && (st[i+1]=='V')) || ((st[i]=='K') && (st[i+1]=='K'))) { f=true;count ++ ;}
- }
- cout << count;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement