Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133803 Kevin 指针遍历字符串 C++ Accepted 1 MS 280 KB 268 2025-10-22 15:31:28

Tests(2/2):


Code:

#include<iostream> #include<cstring> using namespace std; int main() { char a[50]; int s=0; cin>>a; int len=strlen(a); char *p=a; for(int i=0;i<len;i++){ if(*p==a[len-1]){ s++; } p++; } cout<<s; return 0; }