Skip to main content

2066.解码

思路

暴力

代码

#include <bits/stdc++.h>

using namespace std;

int cnt = 0;
string a;

int main() {
cin >> a;

for (int i = 0; i < a.size(); i++) {
if (a[i] >= '0' && a[i] <= '9') {
cnt = a[i] - '0';
for (int j = 0; j < cnt - 1; j++) cout << a[i - 1];
} else cout << a[i];

}

return 0;
}