Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
101727 | 郝王骏程 | 出现k次的字符 | C++ | Compile Error | 0 MS | 0 KB | 526 | 2024-12-16 20:07:43 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int k,sum=1; char a[1000]; cin>>k>>a; for(int i=0;i<=ptrlen(a);i++){ if(a[i+1]==a[i]) sum+1; if(sum==k){ cout<<a[i-1]; return 0;} else{ sum=1; } } cout<<"No"; return 0;
Main.cc: In function 'int main()': Main.cc:11:28: error: 'ptrlen' was not declared in this scope for(int i=0;i<=ptrlen(a);i++){ ^ Main.cc:13:8: warning: statement has no effect [-Wunused-value] sum+1; ^ Main.cc:23:13: error: expected '}' at end of input return 0; ^