Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- int main()
- {
- using namespace std;
- string text;
- getline(cin, text);
- ostringstream out;
- int num = 0;
- char ch;
- while (!text.empty())
- {
- istringstream iss(text);
- iss >> num;
- iss.clear();
- iss.get(ch);
- if (num)
- {
- while (num--)
- out << ch;
- num = 0;
- }
- else
- out << ch;
- getline(iss, text);
- }
- cout << out.str() << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment