When this happens, the most likely culprit is that the program that you built is already running, and because Windows locks files that are in use, attempts to re-link it fail because the existing executable is locked and thus the linker is not allowed to touch it. So the solution is, kill the running program (you may need to use the task manager to do this).
This question has come up innumerable times on Stack Overflow and the reason is always due to trying to run a program that gathers input. The program listed above does this, for example.
In short, that doesn't work; Sublime doesn't forward any input that you type into the output panel to your running program, so it's effectively hung forever in the background waiting for input you can't provide. Then you try to rebuild but the linker fails because it can't delete the existing executable because it's already running.
The solution there is either don't execute (console) programs from Sublime that need to take interactive input, or if you do use a build system that will first open a command prompt window and execute your program in that; then you can interact with it directly.