#define LOCAL
#include<stdio.h>
#include<string.h>
int main()
{
#ifdef LOCAL
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
char c;
int t=0;
while((c=getchar())!=EOF) //这个条件很巧妙哟。。。
{
if(c=='b')
{ while(t--) putchar(' ');t++;} //原来t--跳出之后t成了-1,哎,下次注意!
else if(c=='!')
putchar('\n');
else if(c=='\n')
putchar(c);
else if(isdigit(c))
{
t+=c-'0';
}
else if(t)
{
{while(t--) putchar(c);t++;}
}
}
return 0;
}
uvaoj 445 - Marvelous Mazes
最新推荐文章于 2019-10-09 16:03:19 发布