I am working on an algorithm, and I am asked to print "QUIT" when there is no more input to the program.
I am using
char c;
while(c = getchar()){...}
because I need to look for '\n'
characters and numbers.
So I copy the sample input and paste it on my program's to test it, but it keeps waiting for another input and therefore I get a time limit exceeded when I submit it.
PS: I can't use multithreading.