Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
14893 仇翌楷 指针遍历字符串 C++ Accepted 2 MS 728 KB 223 2021-07-08 18:51:05

Tests(2/2):


Code:

#include <bits/stdc++.h> using namespace std; string a; int main() { getline(cin, a); int cnt = 0, len = a.size(); for (int i = 0; i < len; i++) { if (a[i] == a[len - 1]) cnt++; } cout << cnt; return 0; }