Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
125152 | 王金檐 | 出现k次的字符 | C++ | Compile Error | 0 MS | 0 KB | 349 | 2025-07-13 15:47:11 |
#include <iostream> #include <cstring> using namespace std; string s; int main(){ int k; cin>>k; cin>>s; int n=s.size(); if(n==1&&k==1)[ cout<<s[1]; int c; for(int i=1;i<n;i++){ if(s[i]==s[i-1]){ c++; if(c==k){ cout<<s[i]; return 0; } } else{ c=1; } } cout<<"yes"; return 0; }
Main.cc: In function 'int main()': Main.cc:11:2: warning: capture of variable 'std::cout' with non-automatic storage duration cout<