| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 112020 | 秦浩然 | 出现k次的字符 | C++ | Compile Error | 0 MS | 0 KB | 500 | 2025-03-08 12:04:47 |
#include<iostream> #include<cstring> using namespace std; int main(){ string s1; int k; cin>>s1>>k; int len=s1.size(); if(k==1){ cout<<s[0]; return 0; } int t=1; for(int i=0;i<len-1;i++){ if(s[i]==s[i+1]){ t++; if(t==k){ cout<<s[i]; return 0; } } else{ t=1; } } cout<<"No"; return 0; }
Main.cc: In function 'int main()':
Main.cc:10:15: error: 's' was not declared in this scope
cout<