Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
101720 | 黄枳润 | 出现k次的字符 | C++ | Runtime Error | 0 MS | 276 KB | 459 | 2024-12-16 19:57:17 |
#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=0; char a[2501]; cin>>k>>a; for(int i=0;a!='\0';i++){ if(a[i-1]==a[i]) sum++; if(sum==k) cout<<a[i]; } cout<<"NO"; return 0; }
Runtime Error:Segmentation fault