aboutsummaryrefslogtreecommitdiff
path: root/works/solutions/acwing/2066.cpp
blob: 7a6132b365dcc1359d19b57e086848b34387267c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <cctype>
#include <iostream>

int main() {
  std::string input;
  std::cin >> input;
  std::string result;

  for (int i = 0; i < input.size(); i++) {
    if (std::isalpha(input[i])) {
      result.push_back(input[i]);
    } else {
      int c = input[i] - '1';
      result.append(c, input[i - 1]);
    }
  }

  std::cout << result;

  return 0;
}