| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 112021 | 殷佳雨萱 | 出现k次的字符 | C++ | Compile Error | 0 MS | 0 KB | 360 | 2025-03-08 12:04:51 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; int k; cin>>k; cin>>s; int len=s.size(); if(k=1){ cout<<s[0]; return 0; } int t=1; for(int i=0;i<len;i++){ if(s[i]==s[i+1]){ t++; if(t==ka){ cout<<s[i]; return 0; } else{ t=1; } } } cout<<"No"; }
Main.cc: In function 'int main()':
Main.cc:9:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
if(k=1){
^
Main.cc:17:13: error: 'ka' was not declared in this scope
if(t==ka){
^