[英]How to setup cpp build file for sublime text?
I am trying to setup up sublime text for competitive programming.我正在尝试为竞争性编程设置崇高的文本。 I want to pass input from some file say "inputf.in" and get the output in some file say "outputf.txt".我想从某个文件中传递输入,例如“inputf.in”,并在某个文件中获取 output,例如“outputf.txt”。
I found a solution online, but it was for windows.我在网上找到了一个解决方案,但它是针对 windows 的。 I made a few changes to make it work for ubuntu.我做了一些更改以使其适用于 ubuntu。
For windows适用于 windows
{
"cmd": ["g++.exe", "-std=c++17", "${file}",
"-o", "${file_base_name}.exe",
"&&", "${file_base_name}.exe<inputf.in>outputf.out"],
"shell":true,
"working_dir":"$file_path",
"selector":"source.cpp"
}
For ubuntu对于 ubuntu
{
"cmd": ["g++ -std=c++17 ${file} -o ${file_base_name} && ./${file_base_name} < inputf.in > outputf.txt"],
"shell":true,
"working_dir":"$file_path",
"selector":"source.cpp"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.