#54267: 補程式碼


hch980506@gmail.com (申有娜我老婆)


#include <cctype>
#include <iostream>
#include <string>
using namespace std;
int main() {
    string input;
    while (cin >> input) {
        int times = 0;
        for (char c : input) {
            if (isdigit(c)) {
                times += c - '0';
            } else if (c == 'b') {
                while (times--) {
                    cout << ' ';
                }
                times = 0;
            } else if (c == '!') {
                cout << '\n';
            } else {
                while (times--) {
                    cout << c;
                }
                times = 0;
            }
        }
        cout << '\n';
    }
}