holes in a text

http://www.codechef.com/viewsolution/2375372 this is my solution to the holes in a text problem.Could anyone please tell me whats wrong?

There is a bug in your program.

Use getchar() after scanf() statement.

 scanf("%d",&T);
 getchar();
 while(T!=0)

It surely gives AC.

1 Like

Or, use scanf("%d\n", &T);

1 Like

Thank you for your help.:slight_smile:

cani use switch instead ???
my code couldnt be accpted due to exceeding time limit … why???