Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 C++ .exe,我想使用命令提示符从文件中读取数据。我被告知要输入prog.exe < case.in,但这只有在两个文件都在C:\Users\Owner> folder. 有没有办法让这两个文件都位于不同的位置?
prog.exe < case.in
C:\Users\Owner> folder
是的,您可以使用完整路径或使用输入的相对路径。例如,如果输入文件位于D:\somewhere\else:
D:\somewhere\else
prog.exe < "D:\somewhere\else\input.in"
你可能有 prog.exe "/path/to/case.in",甚至/path/to/prog.exe "/path/to/case.in"
prog.exe "/path/to/case.in"
/path/to/prog.exe "/path/to/case.in"