Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
255 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;
int foo(string &n,char a) {
	int counter = 0;
	for (char i : n) {
		if (a == i) counter++;
	}
	return counter;
}
int main() {
	string n; char a;
	cin >> n >> a;
	cout << foo(n, a);
}