Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string in;
- int i=0,f=1;
- cin>>in;
- while(i<in.length())
- {
- if(isdigit(in[i])!=0)
- {
- if(isdigit(in[i+1])!=0)
- {
- f = (in[i]-'0')*10 + (in[i+1]-'0');
- for(int a=1;a<f;a++)
- cout<<in[i+2];
- } else {
- f = in[i]-'0';
- for(int a=1;a<f;a++)
- cout<<in[i+1];
- }
- } else {
- cout<<in[i];
- }
- i++;
- }
- cout<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement