Advertisement
Zuneve

eee

Nov 3rd, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main() {
  5. string s;
  6. cin >> s;
  7. int cnt=0;
  8. for (int i = 0; i<=s.size()-5; i++) {
  9. if (s[i]=='>' and s[i+1]=='>' and s[i+2]=='-' and
  10. s[i+3]=='-' and s[i+4]=='>' or s[i]=='<' and s[i+1]=='-'
  11. and s[i+2]=='-' and s[i+3]=='<' and s[i+4]=='<') cnt++;
  12. } cout << cnt;
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement