Run ID:14894

提交时间:2021-07-08 18:52:11

#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 (s[i] == c) { cnt++; } p++; } cout << cnt; return 0; }