Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100621 | 罗子童 | 出现k次的字符 | C++ | Wrong Answer | 0 MS | 276 KB | 601 | 2024-12-08 18:12:03 |
#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 s1=1,m; char s[1001]; cin>>m>>s; for(int i=1;s[i]!='\0';++i){ if(s[i]==s[i+1]){ if(s[i+1]==s[i+2]){ cout<<s[i]; break; } } else{ s1=1; } } if(s1!=1){ cout<<"No"; } return 0; }
------Input------
2 aabbcc
------Answer-----
a
------Your output-----