Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150879 李朋秦 指针遍历字符串 C++ Accepted 1 MS 272 KB 212 2026-04-02 09:10:02

Tests(2/2):


Code:

#include<bits/stdc++.h> using namespace std; int main() { char s[31],t; cin>>s; char *p1=s; int l=strlen(s),c=0; t=*(p1+l-1); for(int i=0;i<l;i++){ if(t==s[i])c++; }cout<<c; return 0; }