1. 下载好DEVc++软件,安装(略)

2.在sublime text 中,工具->编译系统->新建编译系统

填写如下内容:

{

    "path": "C:/Program Files (x86)/Dev-Cpp/MinGW64/bin",
    "shell_cmd": "g++ -std=c++11 \"${file}\" -o \"${file_path}/${file_base_name}\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",

    "variants":
    [
        {
            "name": "Run",
            "shell_cmd": "g++ -std=c++11 \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\" < input.txt > output.txt"
        }
    ]
}

注意: path参数是devC++ 中MinWG的工作目录

    在shell_cmd中的 -std=c++11表示支持 c++11 ,可自行决定是否需要

3.设置快捷键F5为 编译+运行,方便使用

  首选项->快捷键设置->

  添加内容:

{ "keys": ["f5"], "command": "build", "args": {"variant": "Run"} },

4.使用的效果:在 .cpp文件同目录下创建intput.txt文件,output.txt文件运行时会自动生成,

  可以通过sublime中的分组功能产生如下效果: