Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120171 吴天辰 出现k次的字符 C++ Compile Error 0 MS 0 KB 258 2025-05-24 11:35:13

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int k,t=1; cin>>k; cin>>a+1; int len=strlen(a+1); for(int i=1;i<=len;i++){ if(t>=k){ cout<<a[i]; return 0; } if(a[i]==a[i+1]) t++; else t=1; } cout<<"NO"; return 0;


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:6: error: 'a' was not declared in this scope
 cin>>a+1;
      ^
Main.cc:19:10: error: expected '}' at end of input
  return 0;
          ^