Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string s;
- cin >> s;
- int cnt=0;
- for (int i = 0; i<=s.size()-5; i++) {
- if (s[i]=='>' and s[i+1]=='>' and s[i+2]=='-' and
- s[i+3]=='-' and s[i+4]=='>' or s[i]=='<' and s[i+1]=='-'
- and s[i+2]=='-' and s[i+3]=='<' and s[i+4]=='<') cnt++;
- } cout << cnt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement