why is ut wrong...

General topic about Valladolid Online Judge

Moderator: Board moderators

Post Reply
acmmamun
New poster
Posts: 5
Joined: Tue Jul 19, 2005 1:02 pm
Location: Bangladesh
Contact:

why is ut wrong...

Post by acmmamun »

#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;
}
There are nothing to say about me....
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post by Wei-Ming Chen »

Can you tell me what problem you are writing?
Post Reply

Return to “General”