Here is my code:
#include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
int len;
string s;
int main()
{
/*
freopen("data.in","r",stdin);
freopen("data.out","w",stdout);
//*/
while(getline(cin,s))
{
len=s.length();
for(int i=0;i<len;i++)
{
int counter=0;
while(s[i]>='0'&&s[i]<='9')
{
counter+=(s[i]-'0');
i++;
}
for(int j=1;j<=counter;j++)
cout<<(s[i]=='b'?' ':s[i]);
if(s[i]=='!') cout<<endl;
}
cout<<endl;
}
return 0;
}
posted on 2011-01-23 21:32
lee1r 阅读(397)
评论(0) 编辑 收藏 引用 所属分类:
题目分类:字符串处理