[英]How to setup cpp build file for sublime text?
我正在嘗試為競爭性編程設置崇高的文本。 我想從某個文件中傳遞輸入,例如“inputf.in”,並在某個文件中獲取 output,例如“outputf.txt”。
我在網上找到了一個解決方案,但它是針對 windows 的。 我做了一些更改以使其適用於 ubuntu。
適用於 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"
}
對於 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.