心如止水
Je n'ai pas le temps
posts - 400,comments - 130,trackbacks - 0
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 阅读(387) 评论(0)  编辑 收藏 引用 所属分类: 题目分类:字符串处理

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理