Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int CountStr(string s) {
- int count = 0;
- for (int i = 0; i < s.size(); i++)
- if (s[i] == '+') count++;
- return count;
- }
- int main() {
- setlocale(LC_CTYPE, "");
- string str = "qwerty+2345+g";
- cout << CountStr(str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment