Advertisement
TimxAG

Untitled

Apr 16th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. int main()
  2. {
  3. string st; int count=0,i;
  4. bool f=false;
  5. cin >> st;//cout << st.size();
  6. fo(i,st.size()-1)
  7. {
  8. // cout << "1";
  9. if ((st[i]=='V') && (st[i+1]=='K')) count ++ ;
  10. if (!f)
  11. if (((st[i] == 'V') && (st[i+1]=='V')) || ((st[i]=='K') && (st[i+1]=='K'))) { f=true;count ++ ;}
  12. }
  13. cout << count;
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement