Use an assert instead of an if to verify the input data. Otherwise any mistake you make in the condition will be very hard to find. For example, like this one: 1<=t<=10
(though, it is pretty harmless given that it is always true).
Compile with warnings enabled, -Wall flag in gcc/clang, you can also try -Weverything in clang. As far as I can see doing this would actually answer your question, which is that main should be defined to return an int not a void.