这题呢就是一个模拟,没了……
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
scanf("%d", &n);
while (n--) {
string s; cin >> s;
for (int i = 0; i < s.size(); i++) {
if (s[i] == '0') cout << s[i];
else {
int j = i + 1, cnt = 1;
while (s[i] == s[j] && j < s.size()) {
j++; cnt++;
if (cnt == 5) { printf("11111"); i = j; break; }
}
if (cnt != 5) cout << s[i];
}
}
cout << endl;
}
return 0;
}
hi
hi
打术士吗
no
刷题去了
哦