I\'m writing a piece of code in C that iterates T times and each time takes as input the text of a little song on which it will perform some counting operation (counting the len
There's a \n
left in the input buffer, see http://c-faq.com/stdio/scanfinterlace.html
A quote from the link:
As a general rule, you shouldn't try to interlace calls to scanf with calls to gets() (or any other input routines); scanf's peculiar treatment of newlines almost always leads to trouble. Either use scanf to read everything or nothing.