Run ID:14900
提交时间:2021-07-08 19:47:43
#include <iostream> #include <cstring> using namespace std; char s[35]; int main() { cin >> s; char *p = s; char c = s[strlen(s) - 1]; int cnt = 0; for (int i = 0; i < strlen(s); i++) { if (*(p + i) == c) { cnt++; } } cout << cnt; return 0; }