Hei can anybody help me with this problem? i getting wrong answer with this problem all the time. Can anybody give any typical data to test: Here is my program:
you have to replace ONLY LAST THREE DOTS ..... in input data is probably test with more then one group of three dots or more than three dots in line ... btw this problem is very easy )
Can anybody please help me... I have tried out quite a few test cases... and even with 1, 2 or more than 3 sequential dots.. which shud be treated as a string....
My prog is giving me correct output for all MY test input, but everytime it is WA.....
does anybody have any idea as to what the judge's test data might be containing which could be tripping my code ?
scanf() reads upto whitespace like new line and discards it whereas gets() stores the whitespace. So when you use scanf a whitespace is actually left in the buffer and immediate call to gets() causes this whitespace to be stored that is a blank line. That is why you were getting RE, trying to read from a blank string!
Writing this way also might have solved your problem