Using C++11 threading facilities, you can simply spawn a "worker" thread that does the work while you wait for the input.
std::async is an easy way to asynchronously get a result of an operation; your problem description isn't very precise, so I don't know what else I might add here.
It can be done without threading, but then you would need an asynchrounous access to the input, which in general isn't cross-platform.
After Martin's comment, I actually see the problem with a greater clarity; in this case, your best bet is probably to look for more abstracted IO APIs, which will provide nonblocking input, or create your own based on OS-specific API.