水
2025-04-25 19:02:31
发布于:广东
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int t[10];
string s;
int n;
int main(){
cin >> s >> n;
while (n--){
string ns = "";
for (int i=0;i<s.size();i++){
int t = i;
while (s[i+1]==s[i]){
i++;
}
int x = i-t+1;
int y = s[t]-'0';
ns += to_string(x) + to_string(y);
}
s = ns;
}
cout << s;
return 0;
}
这里空空如也
有帮助,赞一个