aa制
2025-06-29 15:55:10
发布于:重庆
0阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
string s1;
int r;
cin>>s1>>r;
while(r--){
string t;
for(int i=0;i<s1.size();){
int j=i;
while(j<s1.size() && s1[j]==s1[i]){
j++;
}
int cnt=j-i;
t+=(to_string(cnt)+s1[i]);
i=j;
}
s1=t;
}
cout<<s1;
}
这里空空如也
有帮助,赞一个