#include <stdio.h>
#include <string.h>
char in[10000],ch;
int len,t;
int main(){
int i,j,flg;
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
while(gets(in)){
len = strlen(in);
flg = 1;
i=0;
while(i<len){
if(in=='!'){
printf("\n");
i++;
}
else if(in>='0' && in<='9'){
if(in[i+1]>='0' && in[i+1]<='9'){
t = (in - '0') + (in[i+1] - '0');
ch = in[i+2];
i+=3;
}
else{
t = in - '0';
ch = in[i+1];
i+=2;
}
for(j=1;j<=t;j++){
if(ch=='b')
printf(" ");
else
printf("%c",ch);
}
}
else{
printf("%c",in);
i++;
}
if(i+1==len && in=='!')
flg = 0;
}
if(flg)
printf("\n");
}
return 0;
}
why is ut wrong...
Moderator: Board moderators
why is ut wrong...
There are nothing to say about me....
-
- Experienced poster
- Posts: 122
- Joined: Sun Nov 13, 2005 10:25 am
- Location: Taiwan