As grumpy said, this question is language agnostic. As it is referring to OS redirection of the standard input/output.
The solution is simple; in windows, you can run the program like this:
Code:
q19.exe <Input.txt> results.txt
This will simply redirect the standard input/output to read and write information to a file instead of the console. That means that operations such as std::cin >> x and std::cout << x will read x from Input.txt and write its value on results.txt. It's important to notice that the input and output text files must be in the same directory as the executables and can have any name, not necessarily "input.txt" and "output.txt".