Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string input; char c; int answer = 0;
- getline(cin, input);
- cin >> c;
- for (int i = 0; i < input.length(); i++) if (input[i] == c) answer++;
- cout << answer << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement