Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
304 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;
int func1(string a, char b) {
	int m = a.size(), counter = 0;
	for (int i = 0; i < m; i++)
	{
		if (a[i] == b) {
			counter++;
		}
	}
	return counter;
}
int main(){
	string a; cin >> a;
	char b; cin >> b;
	cout << func1(a, b);
}