Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
269 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;
int rep(string& a, char b) {
	int i,j = 0;
	for ( i = 0; i < a.size(); i++)
	{
		if (a[i] == b) j++;

	}
	return j;

};
int main()
{
	string a;
	char b;
	cin >> a >> b;
	cout << rep(a,b);
}