fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s;
  7. getline(cin, s);
  8. char c;
  9. cin >> c;
  10. int L = s.length(), k = 0;
  11. for(int i = 0; i < L; i++){
  12. if(s[i] == c || s[i] == c - 32)k++;
  13. }
  14. cout << k;
  15. return 0;
  16. }
Success #stdin #stdout 0s 15232KB
stdin
aAaAaBbAabaAaAaBbAabaAaAaBbAabaAaAaBbAabaAaAaBbAabaAaAaBbAabaAaAaBbAabaAaAaBbAabaAaAaBbAabaAaAaBbAab
a
stdout
70