| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 150878 | 李朋秦 | 指针遍历字符串 | C++ | Wrong Answer | 1 MS | 276 KB | 214 | 2026-04-02 09:09:40 |
#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-1;i++){ if(t==s[i])c++; }cout<<c; return 0; }
------Input------
aaaaaaaaaaabba
------Answer-----
12
------Your output-----
11