命令提示符输入和输出

Command Prompt Input and Output

我想从 'input.txt' 获取数据到 运行 'main.exe',然后将该程序的结果与该数据一起保存到 'output.txt'。 如果可能的话,我想用 的形式写 wwith 。

首先您需要编译您的 C++ 程序,然后 运行 使用两个参数编译它。参见 cplusplus.com for some tutorials on file in and file out and the resource for taking in command line arguments: https://www.geeksforgeeks.org/command-line-arguments-in-c-cpp/