Untitled
#include <iostream> #include <string> using namespace std; int main() { string a; int count = 0; cin >> a; for (int i = 0; i < a.length(); i++) { if (a[i] == 'a') { count += 1; } } cout << count; }
#include <iostream> #include <string> using namespace std; int main() { string a; int count = 0; cin >> a; for (int i = 0; i < a.length(); i++) { if (a[i] == 'a') { count += 1; } } cout << count; }