Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120401 黄睿杰 出现k次的字符 C++ Compile Error 0 MS 0 KB 295 2025-05-25 16:56:33

Tests(0/0):


Code:

#include<iostream> #include<cstring> using namespace std; char s[10000]; int main(){ int k.t=1; cin>>k>>s+1; int l=strlen(s+1); for(int i=1;i<=l;i++){ if(t>=k){ cout<<s[i]; return 0; } if(s[i]==s[i+1]) t++; else t=1; } cout<<"No"; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:7: error: expected initializer before '.' token
  int k.t=1;
       ^
Main.cc:7:7: error: 'k' was not declared in this scope
  cin>>k>>s+1;
       ^
Main.cc:10:6: error: 't' was not declared in this scope
   if(t>=k){
      ^
Main.cc:15:7: error: 't' was not declared in this scope
       t++;
       ^
Main.cc:17:7: error: 't' was not declared in this scope
       t=1;
       ^