Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
117765 | 任斌 | 指针遍历字符串 | C++ | Runtime Error | 0 MS | 268 KB | 204 | 2025-04-20 11:58:14 |
#include<bits/stdc++.h> using namespace std; int main() { char a[31],*p; int c=0,l,z; cin>>a; l=strlen(a); z=*(p+l-1); for(int i=0;i<l;i++){ if(z==*p)c++; p++; } cout<<c; return 0; }
Runtime Error:Segmentation fault