版本比较
vscode 配置
正文
增加 228 行删除 96 行
21 行未改动22232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613733 行未改动1711721731741751761771781799 行未改动18919019119219319419519619720 行未改动218219220221222223224225226239 行未改动全部展开21 行未改动如需在 VS Code 内按快捷键编译,可创建 `.vscode/tasks.json` 文件。```json{"version": "2.0.0","tasks": [{"label": "编译 C++(评测版)","type": "shell","command": "g++","args": ["-std=c++14","-O2","-Wall","-Wextra","-g","-Wl,--stack=1024000000","${file}","-o","${fileDirname}/${fileBasenameNoExtension}.exe"],"options": {"cwd": "${fileDirname}","shell": {"executable": "C:\\Windows\\System32\\cmd.exe","args": ["/d", "/c"]}},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": true},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "编译 C++(调试版)","type": "shell","command": "g++","args": ["-std=c++14","-O0","-g","-Wall","-Wextra","-Wl,--stack=1024000000","${file}","-o","${fileDirname}/${fileBasenameNoExtension}.exe"],"options": {"cwd": "${fileDirname}","shell": {"executable": "C:\\Windows\\System32\\cmd.exe","args": ["/d", "/c"]}},"problemMatcher": ["$gcc"],"group": "build","presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "运行 C++","type": "shell","command": "${fileDirname}/${fileBasenameNoExtension}.exe","options": {"cwd": "${fileDirname}"},"dependsOn": ["编译 C++(评测版)"],"dependsOrder": "sequence","group": {"kind": "test","isDefault": true},"presentation": {"reveal": "always","panel": "shared","clear": true},"problemMatcher": []}]}```配置后,按 `Ctrl+Shift+B` 即可编译当前文件。## 一键编译运行`Preferences: Open Keyboard Shortcuts (JSON)````txt// 将键绑定放在此文件中以覆盖默认值[{"key": "ctrl+f5","command": "workbench.action.tasks.runTask","args": "运行 C++"}]```# launch.json```txt{"version": "0.2.0","configurations": [{33 行未改动# 颜色配置`Preferences: Open User Settings (JSON)````txt{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,9 行未改动"terminal.integrated.enableMultiLinePasteWarning": "never"}``````txt{"workbench.colorCustomizations": {"editorCursor.foreground": "#ffffff","editorCursor.background": "#ffffff",20 行未改动}}``````txt{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,239 行未改动全部展开21 行未改动22232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826933 行未改动3033043053063073083093103119 行未改动32132232332432532632732832920 行未改动350351352353354355356357358239 行未改动全部展开21 行未改动如需在 VS Code 内按快捷键编译,可创建 `.vscode/tasks.json` 文件。```json{"version": "2.0.0","tasks": [{"label": "编译 C++(评测版)","type": "shell","command": "/usr/bin/g++","args": ["-std=c++14","-O2","-Wall","-Wextra","-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": true},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "编译 C++(调试版)","type": "shell","command": "/usr/bin/g++","args": ["-std=c++14","-O0","-g","-Wall","-Wextra","-fsanitize=address,undefined","${file}","-o","${fileDirname}/${fileBasenameNoExtension}"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": false},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "运行 C++","type": "shell","command": "${fileDirname}/${fileBasenameNoExtension}","options": {"cwd": "${fileDirname}"},"dependsOn": ["编译 C++(评测版)"],"dependsOrder": "sequence","presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []},{"label": "仅运行 C++","type": "shell","command": "${fileDirname}/${fileBasenameNoExtension}","options": {"cwd": "${fileDirname}"},"presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []},{"label": "运行 Python","type": "shell","command": "python3","args": ["${file}"],"options": {"cwd": "${fileDirname}"},"presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []}]}```windows 中:```json{"version": "2.0.0","tasks": [{"label": "编译 C++(评测版)","type": "shell","command": "g++","args": ["-std=c++14","-O2","-Wall","-Wextra","-g","${file}","-o","${fileDirname}\\${fileBasenameNoExtension}.exe","-static-libgcc","-static-libstdc++"],"options": {"cwd": "${fileDirname}"},"problemMatcher": ["$gcc"],"group": {"kind": "build","isDefault": true},"presentation": {"reveal": "silent","panel": "shared","clear": true}},{"label": "运行 C++","type": "shell","command": "${fileDirname}\\${fileBasenameNoExtension}.exe","options": {"cwd": "${fileDirname}"},"dependsOn": ["编译 C++(评测版)"],"dependsOrder": "sequence","presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []},{"label": "运行 Python","type": "shell","command": "python","args": ["${file}"],"options": {"cwd": "${fileDirname}"},"presentation": {"reveal": "always","panel": "shared","clear": true,"focus": true},"problemMatcher": []}]}```## 一键编译运行`Preferences: Open Keyboard Shortcuts (JSON)````json[{"key": "ctrl+shift+b","command": "workbench.action.tasks.build","when": "resourceLangId == cpp"},{"key": "ctrl+f5","command": "workbench.action.tasks.runTask","args": "运行 C++","when": "resourceLangId == cpp"},{"key": "ctrl+alt+r","command": "workbench.action.tasks.runTask","args": "仅运行 C++","when": "resourceLangId == cpp"},{"key": "ctrl+alt+p","command": "workbench.action.tasks.runTask","args": "运行 Python","when": "resourceLangId == python"},{"key": "ctrl+alt+z","command": "glassit.increase"},{"key": "ctrl+alt+c","command": "glassit.decrease"}]```# launch.json```json{"version": "0.2.0","configurations": [{33 行未改动# 颜色配置`Preferences: Open User Settings (JSON)````json{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,9 行未改动"terminal.integrated.enableMultiLinePasteWarning": "never"}``````json{"workbench.colorCustomizations": {"editorCursor.foreground": "#ffffff","editorCursor.background": "#ffffff",20 行未改动}}``````json{"vs64.showWelcome": false,"code-runner.runInTerminal": true,"editor.fontSize": 20,239 行未改动全部展开