Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int quan;
  7. char word[100005];
  8.  
  9. int main()
  10. {
  11. cin >> word;
  12.  
  13. for ( int i = 0; i < strlen(word); i++ )
  14. {
  15. if ( word[i] == ':' || word[i] == ';' )
  16. {
  17. for ( int x = i+1; x < strlen(word); x++ )
  18. {
  19. if ( word[x] == '-' )
  20. {
  21. continue;
  22. }
  23. if ( word[x] == '(' || word[x] == ')' || word[x] == '[' || word[x] == ']' )
  24. {
  25. quan++;
  26. i = x-1;
  27. break;
  28. }
  29. else
  30. {
  31. i = x-1;
  32. break;
  33. }
  34. }
  35. }
  36. }
  37.  
  38. cout << quan;
  39.  
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement