Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101732 郝王骏程 出现k次的字符 C++ Compile Error 0 MS 0 KB 511 2024-12-16 20:21:00

Tests(0/0):


Code:

#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(sum==k){ cout<<a[i-1]; return 0;} } if(a[i]==a[i+1]) sum++; else sum=1; cout<<"No"; return 0; }


Run Info:

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:16:10: error: 'i' was not declared in this scope
     if(a[i]==a[i+1])
          ^