Have you actually tested the program with an invalid char, like a number, in the key? Try using the alphabet with a 2 instead of an a and see what it does.
It should be incredibly obvious why the program "timed out" while check50 was waiting for it to end.
The fix should be very obvious too. If not, leave a message.
If this answers your question, ...
It's a common mistake. Look at this code (comments removed):
int main(int argc, string argv)
string key = argv;
The first line in main is trying to read argv. If no parameter is given, then argc = 1 and argv doesn't exist. (FYI, argv contains the program name as it was entered when the program was invoked.) Because argv doesn't ...