题解

LS_linzihan 2023-11-11 10:45:15 6 返回题目

#include <bits/stdc++.h> using namespace std;

int main() { int s,c=1; string a; char b; cin>>s>>a; b=a[0]; for(int i=1; i<a.size(); i++) { if(b==a[i]) c++; else { b=a[i]; c=1; } if(c==s) { cout<<b; return 0; } } cout<<"No"; return 0; }

{{ vote && vote.total.up }}