Add stdin redirection to the keyboard, preventing an infinite loop as scanf attempts to continuously read an empty file.