Skip to content

Commit 7d8fc00

Browse files
committed
第一个C++程序
1 parent 246a5f1 commit 7d8fc00

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

.vscode/tasks.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"tasks": [
3+
{
4+
"type": "cppbuild",
5+
"label": "C/C++: g++.exe 生成活动文件",
6+
"command": "C:\\software\\mingw64\\bin\\g++.exe",
7+
"args": [
8+
"-fdiagnostics-color=always",
9+
"-g",
10+
"${file}",
11+
"-o",
12+
"${fileDirname}\\${fileBasenameNoExtension}.exe"
13+
],
14+
"options": {
15+
"cwd": "${fileDirname}"
16+
},
17+
"problemMatcher": [
18+
"$gcc"
19+
],
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"detail": "调试器生成的任务。"
25+
}
26+
],
27+
"version": "2.0.0"
28+
}

ch01/01.cpp

-7
This file was deleted.

ch01/Ex1_01.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Ex1_01.cpp
2+
// A complete C++ program
3+
4+
#include <iostream>
5+
6+
int main(){
7+
int answer{42}; // Defines answer with value 42
8+
std::cout << "The answer to life, the universe, and everything is "
9+
<< answer
10+
<< std::endl;
11+
12+
return 0;
13+
14+
}

0 commit comments

Comments
 (0)