安装Code Runner插件后重启VS Code。 文件 - 首选项 - 设置 - 新版设置编辑器 - 用户设置 - 扩展 - Run Code configuration 勾选Run In Terminal。 用Ctrl + Alt +N来运行程序,或使用右上角的运行按钮。 image.png