1、 安装MinGW并将MinGW的bin路径添加到系统环境变量
MinGW-w64 - for 32 and 64 bit Windows download | SourceForge.net
MinGW-w64 - for 32 and 64 bit Windows - Browse /mingw-w64 at SourceForge.net
2、安装vscode
3、vscode安装C/C++插件
4、vscode安装Code Runner插件
5、设置vscode
File - preference - settings - extensions - run code configration,将“Run Code Configuration”中的“Run In Terminal"、"Save File Before Run"前面的复选框选中。