Skip to content

Commit 4191334

Browse files
小王同学
1 parent 8fbde42 commit 4191334

33 files changed

+25212
-0
lines changed

01_C++的注释.ipynb

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# C++的注释"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"# 1. 注释"
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"① 在代码中的加一些说明和解释,这些说明和解释就叫注释。\n",
22+
"\n",
23+
"② 注释能方便自己和其他程序员阅读代码。\n",
24+
"\n",
25+
"③ C++的注释,有两种格式:\n",
26+
"\n",
27+
"1. 单行注释: // 描述信息 \n",
28+
" - note:通常放在一行代码的上方,或者一条语句的末尾,对该行代码说明。\n",
29+
"2. 多行注释: /* 描述信息 */ \n",
30+
" - note:编译器在编译代码时,会忽略注释的内容,即不会执行。"
31+
]
32+
}
33+
],
34+
"metadata": {
35+
"kernelspec": {
36+
"display_name": "Python 3.6.3",
37+
"language": "python",
38+
"name": "python3.6.3"
39+
},
40+
"language_info": {
41+
"codemirror_mode": {
42+
"name": "ipython",
43+
"version": 3
44+
},
45+
"file_extension": ".py",
46+
"mimetype": "text/x-python",
47+
"name": "python",
48+
"nbconvert_exporter": "python",
49+
"pygments_lexer": "ipython3",
50+
"version": "3.6.3"
51+
},
52+
"toc": {
53+
"base_numbering": 1,
54+
"nav_menu": {},
55+
"number_sections": false,
56+
"sideBar": true,
57+
"skip_h1_title": false,
58+
"title_cell": "Table of Contents",
59+
"title_sidebar": "Contents",
60+
"toc_cell": false,
61+
"toc_position": {},
62+
"toc_section_display": true,
63+
"toc_window_display": true
64+
}
65+
},
66+
"nbformat": 4,
67+
"nbformat_minor": 4
68+
}

02_C++的main函数.ipynb

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# C++的main函数"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"# 1. main函数"
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"① main函数是一个程序的入口\n",
22+
"\n",
23+
"② 每个程序都必须有这么一个函数,并且有且只有一个。"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"execution_count": null,
29+
"metadata": {},
30+
"outputs": [],
31+
"source": [
32+
"//下面11行代码的含义就是在屏幕中输出一个 Hello World\n",
33+
"\n",
34+
"#include<iostream>\n",
35+
"using namespace std;\n",
36+
"\n",
37+
"int main() {\n",
38+
"\n",
39+
" cout << \"hello C++\" << endl; //屏幕显示“hello C++”\n",
40+
" system(\"pause\"); //按任意键继续,退出程序\n",
41+
"\n",
42+
" return 0;\n",
43+
"\n",
44+
"}"
45+
]
46+
},
47+
{
48+
"cell_type": "markdown",
49+
"metadata": {},
50+
"source": [
51+
"运行结果: \n",
52+
" - hello C++ \n",
53+
" - 请按任意键继续. . ."
54+
]
55+
}
56+
],
57+
"metadata": {
58+
"kernelspec": {
59+
"display_name": "Python 3.6.3",
60+
"language": "python",
61+
"name": "python3.6.3"
62+
},
63+
"language_info": {
64+
"codemirror_mode": {
65+
"name": "ipython",
66+
"version": 3
67+
},
68+
"file_extension": ".py",
69+
"mimetype": "text/x-python",
70+
"name": "python",
71+
"nbconvert_exporter": "python",
72+
"pygments_lexer": "ipython3",
73+
"version": "3.6.3"
74+
},
75+
"toc": {
76+
"base_numbering": 1,
77+
"nav_menu": {},
78+
"number_sections": false,
79+
"sideBar": true,
80+
"skip_h1_title": false,
81+
"title_cell": "Table of Contents",
82+
"title_sidebar": "Contents",
83+
"toc_cell": false,
84+
"toc_position": {},
85+
"toc_section_display": true,
86+
"toc_window_display": true
87+
}
88+
},
89+
"nbformat": 4,
90+
"nbformat_minor": 4
91+
}

03_C++的打印.ipynb

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# C++的打印"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"# 1. 打印"
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"① cout << \"XXXX\" << endl; 会使得屏幕打印双引号里面的字符串。\n",
22+
"\n",
23+
"② system(\"pause\"); 会使得屏幕的打印界面暂停到该语句这里,按任意键后才会继续运行。"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"execution_count": null,
29+
"metadata": {},
30+
"outputs": [],
31+
"source": [
32+
"//下面11行代码的含义就是在屏幕中输出一个 Hello World\n",
33+
"\n",
34+
"#include<iostream>\n",
35+
"using namespace std;\n",
36+
"\n",
37+
"int main() {\n",
38+
"\n",
39+
" cout << \"hello C++\" << endl; //屏幕显示“hello C++”\n",
40+
" system(\"pause\"); //按任意键继续,退出程序\n",
41+
"\n",
42+
" return 0;\n",
43+
"\n",
44+
"}"
45+
]
46+
},
47+
{
48+
"cell_type": "markdown",
49+
"metadata": {},
50+
"source": [
51+
"运行结果: \n",
52+
" - hello C++\n",
53+
" - 请按任意键继续. . ."
54+
]
55+
}
56+
],
57+
"metadata": {
58+
"kernelspec": {
59+
"display_name": "Python 3.6.3",
60+
"language": "python",
61+
"name": "python3.6.3"
62+
},
63+
"language_info": {
64+
"codemirror_mode": {
65+
"name": "ipython",
66+
"version": 3
67+
},
68+
"file_extension": ".py",
69+
"mimetype": "text/x-python",
70+
"name": "python",
71+
"nbconvert_exporter": "python",
72+
"pygments_lexer": "ipython3",
73+
"version": "3.6.3"
74+
},
75+
"toc": {
76+
"base_numbering": 1,
77+
"nav_menu": {},
78+
"number_sections": false,
79+
"sideBar": true,
80+
"skip_h1_title": false,
81+
"title_cell": "Table of Contents",
82+
"title_sidebar": "Contents",
83+
"toc_cell": false,
84+
"toc_position": {},
85+
"toc_section_display": true,
86+
"toc_window_display": true
87+
}
88+
},
89+
"nbformat": 4,
90+
"nbformat_minor": 4
91+
}

0 commit comments

Comments
 (0)