{"id":20374497,"url":"https://github.com/zzy979/ppp-code","last_synced_at":"2025-07-19T13:07:00.718Z","repository":{"id":47959397,"uuid":"516430348","full_name":"ZZy979/PPP-code","owner":"ZZy979","description":"《C++程序设计原理与实践》书中代码和习题解答","archived":false,"fork":false,"pushed_at":"2024-02-18T02:52:46.000Z","size":3832,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T07:12:43.949Z","etag":null,"topics":["cpp","cpp-programming-language"],"latest_commit_sha":null,"homepage":"https://zzy979.github.io/posts/ppp-note-index/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZZy979.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-21T15:43:20.000Z","updated_at":"2025-04-09T10:22:05.000Z","dependencies_parsed_at":"2023-09-28T20:14:26.545Z","dependency_job_id":"f6d74df6-db22-4ae0-998f-d8bedabd47ad","html_url":"https://github.com/ZZy979/PPP-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZZy979%2FPPP-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZZy979%2FPPP-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZZy979%2FPPP-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZZy979%2FPPP-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZZy979","download_url":"https://codeload.github.com/ZZy979/PPP-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530571,"owners_count":21119600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp-programming-language"],"created_at":"2024-11-15T01:24:48.519Z","updated_at":"2025-04-12T07:12:53.243Z","avatar_url":"https://github.com/ZZy979.png","language":"C++","readme":"# PPP-code\n《C++程序设计原理与实践》书中代码和习题解答\n\n本书网站：https://www.stroustrup.com/programming.html\n\n笔记：https://zzy979.github.io/posts/ppp-note-index/\n\n# 运行方式\n本项目使用CMake构建，通过IDE或命令行的方式编译并运行其中的代码示例。\n\n## IDE\n直接使用支持CMake的IDE（如CLion, Visual Studio或Visual Studio Code）打开即可。\n\n## 命令行\n以Linux系统为例，使用Unix Makefiles生成器：\n```bash\n$ cmake -G \"Unix Makefiles\" -B cmake-build\n$ cmake --build cmake-build\n$ cmake-build/ch02/hello_world \nHello, World!\n```\n\n# 单元测试\n使用CTest运行单元测试：\n```bash\n$ cd cmake-build/\n$ ctest\n```\n\n# 代码目录\n[std_lib_facilities.h](https://www.stroustrup.com/Programming/std_lib_facilities.h)\n\n## 第2章 Hello, World!\n* [Hello world](ch02/hello_world.cpp)\n\n### 习题\n* [2-1](ch02/exec2-1.cpp)\n\n## 第3章 对象、类型和值\n### 3.1 输入\n* [读取并打印名字](ch03/read_and_write_first_name.cpp)\n\n### 3.3 输入和类型\n* [读取名字和年龄](ch03/read_name_and_age.cpp)\n* [读取名字和年龄（版本2）](ch03/read_name_and_age_v2.cpp)\n* [读取全名](ch03/read_full_name.cpp)\n* [试一试](ch03/read_name_and_age_v3.cpp)\n\n### 3.4 运算和运算符\n* [练习运算符](ch03/double_operators.cpp)\n* [试一试](ch03/integer_operators.cpp)\n* [读取全名（版本2）](ch03/read_full_name_v2.cpp)\n* [读取并比较名字](ch03/read_and_compare_names.cpp)\n\n### 3.5 赋值和初始化\n* [检测重复单词](ch03/detect_repeated_words.cpp)\n\n### 3.6 组合赋值运算符\n* [查找重复单词](ch03/find_repeated_words.cpp)\n\n### 3.9 类型安全\n* [试一试](ch03/unsafe_conversions.cpp)\n\n### 简单练习\n* [信件生成器](ch03/letter_generator.cpp)\n\n### 习题\n* [3-2](ch03/exec3-2.cpp)\n* [3-4](ch03/exec3-4.cpp)\n* [3-5](ch03/exec3-5.cpp)\n* [3-6](ch03/exec3-6.cpp)\n* [3-7](ch03/exec3-7.cpp)\n* [3-8](ch03/exec3-8.cpp)\n* [3-9](ch03/exec3-9.cpp)\n* [3-10](ch03/exec3-10.cpp)\n* [3-11](ch03/exec3-11.cpp)\n\n## 第4章 计算\n### 4.4 语句\n#### 4.4.1 选择语句\n##### 4.4.1.1 if语句\n* [厘米-英寸转换](ch04/convert_length_unit.cpp)\n* [试一试](ch04/convert_currency.cpp)\n\n##### 4.4.1.2 switch语句\n* [厘米-英寸转换(switch)](ch04/convert_length_unit_v2.cpp)\n\n##### 4.4.1.3 switch技术细节\n* [试一试](ch04/convert_currency_v2.cpp)\n\n#### 4.4.2 循环语句\n##### 4.4.2.1 while语句\n* [打印平方数表(while)](ch04/print_squares_table.cpp)\n* [试一试](ch04/print_character_table.cpp)\n\n##### 4.4.2.3 for语句\n* [打印平方数表(for)](ch04/print_squares_table_v2.cpp)\n* [试一试](ch04/print_character_table_v2.cpp)\n\n### 4.6 向量\n#### 4.6.3 一个数值计算的例子\n* [计算温度的平均值和中位数](ch04/mean_median_temperature.cpp)\n\n#### 4.6.4 一个文本处理的例子\n* [简单字典](ch04/simple_dictionary.cpp)\n* [试一试](ch04/bleep_disliked_words.cpp)\n\n### 简单练习\n* [长度统计](ch04/length_statistics.cpp)\n\n### 习题\n* [4-2](ch04/mean_median_temperature.cpp)\n* [4-3](ch04/exec4-3.cpp)\n* [4-4](ch04/exec4-4.cpp)\n* [4-5](ch04/exec4-5.cpp)\n* [4-6](ch04/exec4-6.cpp)\n* [4-9](ch04/exec4-9.cpp)\n* [4-10](ch04/exec4-10.cpp)\n* [4-12](ch04/exec4-12.cpp)\n* [4-14](ch04/exec4-14.cpp)\n* [4-16](ch04/exec4-16.cpp)\n* [4-17](ch04/exec4-17.cpp)\n* [4-18](ch04/exec4-18.cpp)\n* [4-19~4-21](ch04/exec4-21.cpp)\n\n## 第5章 错误\n### 5.6 异常\n#### 5.6.1 参数错误\n* [计算面积](ch05/area.cpp)\n\n### 5.7 逻辑错误\n* [统计温度(bug)](ch05/temperature_stats_buggy.cpp)\n* [试一试](ch05/temperature_stats_fixed.cpp)\n\n### 习题\n* [5-2~5-6](ch05/temperature_converters.cpp)\n* [5-7](ch05/solve_quadratic_equation.cpp)\n* [5-8](ch05/sum_n_integers.cpp)\n* [5-11](ch05/fibonacci_series.cpp)\n* [5-12~5-13](ch05/bulls_and_cows.cpp)\n\n## 第6章 编写一个程序\n* [简单计算器v0](ch06/calculator_v0.cpp)\n* [简单计算器v1](ch06/calculator_v1)\n  * [词法分析器](ch06/calculator_v1/lexer.h)\n  * [语法分析器](ch06/calculator_v1/parser.h)\n  * [主程序](ch06/calculator_v1/main.cpp)\n\n### 习题\n* [6-4](ch06/exec6-4.cpp)\n* [6-5](ch06/exec6-5.txt)\n* [6-7](ch06/exec6-7.txt)\n* [6-9](ch06/exec6-9.cpp)\n* [6-10](ch06/exec6-10.cpp)\n\n## 第7章 完成一个程序\n* [简单计算器v1](ch07/calculator_v2)\n  * [符号表](ch07/calculator_v2/variable.h)\n  * [词法分析器](ch07/calculator_v2/lexer.h)\n  * [语法分析器](ch07/calculator_v2/parser.h)\n  * [主程序](ch07/calculator_v2/main.cpp)\n\n## 第8章 函数相关的技术细节\n### 简单练习\n* [8-1](ch08/use.cpp)\n* [8-2](ch08/swaps.cpp)\n* [8-3](ch08/drill8-3.cpp)\n\n### 习题\n* [8-2](ch08/print_vector.cpp)\n* [8-3](ch08/fibonacci.cpp)\n* [8-4](ch08/fibonacci_test.cpp)\n* [8-5~8-6](ch08/reverse_vector.cpp)\n* [8-7](ch08/exec8-7.cpp)\n* [8-10](ch08/inner_product.cpp)\n* [8-11~8-12](ch08/describe_vector.cpp)\n* [8-13](ch08/print_until.cpp)\n* [8-14](ch08/describe_vector.cpp)\n\n## 第9章 类相关的技术细节\n### 9.8 Date类\n* [Date类](ch09/Chrono.h)\n\n### 简单练习\n* [测试Date类](ch09/Chrono_test.cpp)\n\n### 习题\n* [9-2~9-3](ch09/name_pairs.h)\n* [9-4](ch09/nesting_example.cpp)\n* [9-5~9-7](ch09/book.h)\n* [9-8](ch09/patron.h)\n* [9-9](ch09/library.h)\n* [9-10~9-11](ch09/Chrono.cpp)\n* [9-13](ch09/relational.h)\n\n## 第10章 输入/输出流\n### 10.5 读写文件\n* [读取温度数据文件](ch10/read_temperatures.cpp)\n\n### 10.6 I/O错误处理\n* [读取整数向量](ch10/fill_vector.cpp)\n\n### 10.7 读取单个值\n* 读取一个指定范围内的整数\n  * [get_int函数](ch10/get_int.cpp)\n  * [主程序](ch10/read_integer_in_range.cpp)\n\n### 10.11 读取结构化的文件\n* 读取结构化的温度数据文件\n  * [温度读数数据结构](ch10/temperature_reading.h)\n  * [主程序](ch10/read_structured_temperatures.cpp)\n\n### 简单练习\n* [读写Point](ch10/read_write_points.cpp)\n\n### 习题\n* [10-1](ch10/exec10-1.cpp)\n* [10-2](ch10/store_temps.cpp)\n* [10-3~10-4](ch10/temp_stats.cpp)\n* [10-5](ch10/temperature_reading.cpp)\n* [10-6](ch10/roman_int.h)\n* [10-8](ch10/exec10-8.cpp)\n* [10-9](ch10/exec10-9.cpp)\n* [10-11](ch10/exec10-11.cpp)\n\n## 第11章 定制输入/输出\n### 11.2 输出格式化\n#### 11.2.1 整数输出\n* [使用不同进制输出整数](ch11/output_integer_in_different_bases.cpp)\n\n#### 11.2.2 整数输入\n* [使用不同进制输入整数](ch11/input_integer_in_different_bases.cpp)\n\n#### 11.2.4 精度\n* [使用不同格式输出浮点数](ch11/output_float_in_different_formats.cpp)\n* [设置精度](ch11/set_precision.cpp)\n\n#### 11.2.5 域\n* [设置域宽度](ch11/set_field_width.cpp)\n* [打印联系方式表格](ch11/print_contact_table.cpp)\n\n### 11.3 文件打开和定位\n#### 11.3.2 二进制文件\n* [读写二进制整数文件](ch11/read_write_binary_file.cpp)\n\n### 11.4 字符串流\n* [字符串转浮点数](ch11/str_to_double.cpp)\n\n### 11.7 使用非标准分隔符\n* [Punct_stream类](ch11/punct_stream.h)\n* [自定义分隔符的字典](ch11/custom_separator_dictionary.cpp)\n\n### 简单练习\n* [11-1~11-7](ch11/output_integer_in_different_bases.cpp)\n* [11-8](ch11/input_integer_in_different_bases.cpp)\n* [11-9](ch11/output_float_in_different_formats.cpp)\n* [11-10](ch11/print_contact_table.cpp)\n\n### 习题\n* [11-1](ch11/exec11-1.cpp)\n* [11-2](ch11/exec11-2.cpp)\n* [11-3](ch11/exec11-3.cpp)\n* [11-4](ch11/exec11-4.cpp)\n* [11-5](ch11/exec11-5.cpp)\n* 11-6~11-8\n  * [Punct_stream_v2](ch11/punct_stream_v2.h)\n  * [主程序](ch11/custom_separator_dictionary_v2.cpp)\n* [11-10~11-11](ch11/split.cpp)\n* [11-12](ch11/exec11-12.cpp)\n* [11-13](ch11/exec11-13.cpp)\n* [11-14](ch11/exec11-14.cpp)\n* [11-15](ch11/exec11-15.cpp)\n* [11-16](ch11/exec11-16.cpp)\n\n## 第12章 一个显示模型\n### 12.3 第一个例子\n* [绘制三角形](ch12/draw_triangle.cpp)\n\n### 12.7 使用形状类\n* [基本形状](ch12/shape_primitives.cpp)\n\n### 简单练习\n* [基本形状](ch12/shape_primitives.cpp)\n\n### 习题\n* [12-1](ch12/exec12-1.cpp)\n* [12-2](ch12/exec12-2.cpp)\n* [12-3](ch12/exec12-3.cpp)\n* [12-4](ch12/exec12-4.cpp)\n* [12-7](ch12/exec12-7.cpp)\n* [12-8](ch12/exec12-8.cpp)\n* [12-11](ch12/exec12-11.cpp)\n* [12-12](ch12/exec12-12.cpp)\n\n## 第13章 图形类\n### 13.2 Point和Line\n* [绘制线段](ch13/draw_two_lines.cpp)\n\n### 13.3 Lines\n* [绘制线段2](ch13/draw_two_lines2.cpp)\n* [绘制网格](ch13/draw_grid.cpp)\n\n### 13.4 Color\n* [绘制红色网格](ch13/draw_grid.cpp)\n\n### 13.5 Line_style\n* [绘制红色点线网格](ch13/draw_grid.cpp)\n* [绘制红色加粗虚线网格](ch13/draw_grid.cpp)\n* [绘制有颜色的线段](ch13/draw_two_lines.cpp)\n\n### 13.6 Open_polyline\n* [绘制Open_polyline](ch13/draw_open_polyline.cpp)\n\n### 13.7 Closed_polyline\n* [绘制Closed_polyline](ch13/draw_closed_polyline.cpp)\n\n### 13.8 Polygon\n* [绘制多边形](ch13/draw_polygon.cpp)\n\n### 13.9 Rectangle\n* [绘制矩形](ch13/draw_rectangles.cpp)\n\n### 13.10 管理未命名对象\n* [绘制16×16颜色表](ch13/draw_color_matrix.cpp)\n\n### 13.11 Text\n* [显示文本](ch13/draw_closed_polyline.cpp)\n\n### 13.12 Circle\n* [绘制圆](ch13/draw_circles.cpp)\n\n### 13.13 Ellipse\n* [绘制椭圆](ch13/draw_ellipses.cpp)\n\n### 13.14 Marked_polyline\n* [绘制Marked_polyline](ch13/draw_marked_polyline.cpp)\n\n### 13.15 Marks\n* [绘制Marks](ch13/draw_marks.cpp)\n\n### 13.16 Mark\n* [绘制标记圆心的圆](ch13/draw_circles.cpp)\n\n### 13.17 Image\n* [绘制图像](ch13/draw_images.cpp)\n\n### 简单练习\n* [魔塔](ch13/magic_tower.cpp)\n\n### 习题\n* [13-1](ch13/exec13-1.cpp)\n* [13-2](ch13/exec13-2.cpp)\n* [13-3](ch13/exec13-3.cpp)\n* [13-4](ch13/exec13-4.cpp)\n* [13-5](ch13/exec13-5.cpp)\n* [13-6](ch13/exec13-6.cpp)\n* [13-8~13-10](ch13/exec13-9.cpp)\n* [13-11](ch13/exec13-11.cpp)\n* [13-12](ch13/exec13-12.cpp)\n* [13-13](ch13/draw_color_matrix.cpp)\n\n## 第14章 设计图形类\n### 14.3 基类和派生类\n#### 14.3.3 覆盖\n* [覆盖的例子](ch14/overriding_example.cpp)\n\n### 简单练习\n* [drill14](ch14/drill14.cpp)\n\n### 习题\n* [14-1](ch14/exec14-1.cpp)\n* [14-11~14-13](ch14/exec14-11.cpp)\n* [14-15](ch14/iterator.h)\n* [14-16](ch14/controller.h)\n* [14-17](ch14/standard_exception_class_hierarchy.png)\n\n## 第15章 绘制函数图和数据图\n### 15.2 绘制简单函数图\n* [绘制简单函数图](ch15/graphing_functions.cpp)\n\n### 15.3 Function\n#### 15.3.2 更多例子\n* [绘制简单函数图](ch15/graphing_functions.cpp)\n\n### 15.5 近似\n* [指数函数近似](ch15/exp_approximation.cpp)\n\n### 15.6 绘制数据图\n* [绘制日本人年龄构成](ch15/graphing_japanese_age.cpp)\n\n### 简单练习\n* [绘制函数图像练习](ch15/function_graphing_drill.cpp)\n* [类定义练习](ch15/person.h)\n\n### 习题\n* [15-1](ch15/factorial.cpp)\n* [15-2](ch15/exec15-2.cpp)\n* [15-4](ch15/exec15-4.cpp)\n* [15-5](ch15/exec15-5.cpp)\n* [15-6~15-9](ch15/exec15-8.cpp)\n* [15-11](ch15/exec15-11.cpp)\n\n## 第16章 图形用户界面\n### 16.5 一个实例\n* [Lines_window](ch16/lines_window.h)\n* [主程序](ch16/draw_lines.cpp)\n\n### 16.7 添加菜单\n* [Lines_window](ch16/lines_window.h)\n\n### 简单练习\n* [Lines_window](ch16/lines_window.h)\n\n### 习题\n* [16-3](ch16/exec16-3.cpp)\n* [16-4](ch16/exec16-4.cpp)\n* [16-6](ch16/exec16-6.cpp)\n* [16-9](ch16/exec16-9.cpp)\n* [16-10](ch16/exec16-10.cpp)\n\n## 第17章 向量和自由空间\n### 17.3 内存、地址和指针\n#### 17.3.1 sizeof运算符\n* [试一试](ch17/sizeof_example.cpp)\n\n### 17.5 析构函数\n#### 17.5.2 析构函数和自由存储\n* [试一试](ch17/destructor_example.cpp)\n\n### 17.6 访问元素\n* [简单向量v1](ch17/simple_vector.h)\n\n### 17.9 指针和引用\n#### 17.9.3 示例：链表\n* [双向链表](ch17/doubly_linked_list.h)\n\n#### 17.9.5 链表的应用\n* [链表的应用](ch17/linked_list_use.cpp)\n\n### 17.10 this指针\n* [双向链表v2](ch17/doubly_linked_list_v2.h)\n\n#### 17.10.1 链表的应用\n* [链表的应用v2](ch17/linked_list_use_v2.cpp)\n\n### 简单练习\n* [drill17](ch17/drill17.cpp)\n\n### 习题\n* [17-2](ch17/exec17-2.cpp)\n* [17-3~17-5](ch17/string_algorithm_exec17.cpp)\n* [17-7~17-8](ch17/exec17-7.cpp)\n* [17-9](ch17/exec17-9.cpp)\n* [17-11](ch17/linked_list_use_v2.cpp)\n* [17-13](ch17/exec17-13.cpp)\n\n## 第18章 向量和数组\n* [简单向量v2](ch18/simple_vector.h)\n\n### 18.4 基本操作\n#### 18.4.2 调试构造函数和析构函数\n* [试一试](ch18/debug_ctor_dtor.cpp)\n\n### 18.7 实例：回文\n* [is_palindrome函数](ch18/palindrome.cpp)\n\n### 简单练习\n* [drill18](ch18/drill18.cpp)\n\n### 习题\n* [18-1~18-7](ch18/string_algorithm_exec18.cpp)\n* [18-8](ch18/palindrome.cpp)\n* [18-9](ch17/exec17-9.cpp)\n\n## 第19章 向量、模板和异常\n* [简单向量v3](ch19/simple_vector.h) （简化的`std::vector`）\n\n### 19.3 模板\n#### 19.3.5 整数作为模板参数\n* [简单数组](ch19/simple_array.h) （简化的`std::array`）\n\n### 简单练习\n* [drill19](ch19/drill19.cpp)\n\n### 习题\n* [19-1](ch19/vector_add.h) （实现`std::valarray`的`operator+`）\n* [19-2](ch19/inner_product.h) （实现`std::inner_product()`）\n* 19-3 （实现`std::pair`）\n  * [Pair](ch19/pair.h)\n  * [Symbol_table](ch19/symbol_table.h)\n* 19-4\n  * [双向链表v3](ch19/doubly_linked_list_v3.h)\n  * [链表的应用v3](ch19/exec19-4.cpp)\n* [19-5~19-7](ch19/number.h)\n* [19-8~19-9](ch19/simple_allocator.h) （简化的`std::allocator`）\n* [19-10](ch19/unique_ptr.h) （简化的`std::unique_ptr`）\n* [19-11](ch19/counted_ptr.h) （简化的`std::shared_ptr`）\n\n## 第20章\n### 20.1 存储和处理数据\n#### 20.1.1 使用数据\n* [Jack-and-Jill](ch20/jack_and_jill_v1.cpp)\n\n#### 20.1.2 一般化代码\n* [Jack-and-Jill v2](ch20/jack_and_jill_v2.cpp)\n\n### 20.3 序列和迭代器\n* [试一试](ch20/copy.cpp)\n\n#### 20.3.1 回到示例\n* [Jack-and-Jill v3](ch20/jack_and_jill_v3.cpp)\n\n### 20.4 链表\n* [双向链表v4](ch20/doubly_linked_list_v4.h) （简化的`std::list`）\n\n### 20.5 再次一般化vector\n* [简单向量v3](ch19/simple_vector.h)\n\n### 20.6 示例：简单文本编辑器\n* [简单文本编辑器](ch20/simple_text_editor.h)\n\n### 20.8 使我们的vector适配STL\n* [简单向量v3](ch19/simple_vector.h)\n\n### 20.9 使内置数组适配STL\n* [简单数组](ch19/simple_array.h)\n\n### 简单练习\n* [drill20](ch20/drill20.cpp)\n\n### 习题\n* [20-2](ch20/jack_and_jill_v2.cpp)\n* [20-4](ch20/jack_and_jill_v4.cpp)\n* [20-5](ch19/drill19.cpp)\n* [20-6](ch20/simple_text_editor.cpp)\n* [20-7](ch20/high.h)\n* [20-8~20-10](ch20/simple_text_editor.cpp)\n* [20-12](ch20/exec20-12.cpp)\n* [20-13](ch20/doubly_linked_list_v4.h)\n* [20-14](ch20/singly_linked_list.h) （简化的`std::forward_list`）\n* [20-15](ch20/pvector.h)\n* [20-16](ch20/ovector.h)\n* [20-17](ch20/ownership_vector.h)\n* [20-18~20-19](ch20/range_checked_iterator.h)\n* [20-20](ch20/exec20-20.cpp)\n  * 编译命令：`g++ -std=c++14 -O2 -o exec20-20 exec20-20.cpp`\n  * [测试结果](ch20/exec20-20_result.csv)\n  * [总时间](ch20/exec20-20_total_time.png)\n  * [插入时间](ch20/exec20-20_insert_time.png)\n\n## 第21章 算法和映射\n### 21.4 函数对象\n* [Larger_than函数对象](ch21/larger_than.h)\n\n### 21.5 数值算法\n#### 21.5.2 一般化accumulate()\n* [计算物品总价](ch21/calculate_total_cost.cpp)\n\n#### 21.5.3 inner_product()\n* [计算股票市场指数](ch21/calculate_stock_market_index.cpp)\n\n### 21.6 关联容器\n#### 21.6.1 map\n* [统计单词出现次数](ch21/word_frequency.cpp)\n\n#### 21.6.3 另一个map示例\n* [计算股票市场指数v2](ch21/calculate_stock_market_index_v2.cpp)\n\n### 21.7 拷贝操作\n#### 21.7.2 流迭代器\n* [简单字典v2](ch21/simple_dictionary_v2.cpp)\n\n### 21.8 排序和搜索\n* [排序字符串（不区分大小写）](ch21/sort_strings_ignore_case.cpp)\n\n### 简单练习\n* [21-1](ch21/drill21-1.cpp)\n* [21-2](ch21/drill21-2.cpp)\n* [21-3](ch21/drill21-3.cpp)\n\n### 习题\n* [21-3~21-4](ch21/count.h)\n* [21-6](ch21/exec21-6.cpp)\n* [21-7](ch21/binary_search.h)\n* [21-8](ch21/exec21-8.cpp)\n* 21-9~21-10\n  * [Order类](ch21/order.h)\n  * [主程序](ch21/exec21-9.cpp)\n* 21-11~21-12\n  * [Order_list_window](ch21/order_list_window.h)\n  * [Order_list_table](ch21/order_list_table.h)\n  * [Order_edit_window](ch21/order_edit_window.h)\n  * [Purchase_list_table](ch21/purchase_list_table.h)\n  * [主程序](ch21/exec21-11.cpp)\n* 21-13~21-15\n  * [Word_query](ch21/word_query.h)\n  * [Word_query_window](ch21/word_query_window.h)\n  * [主程序](ch21/exec21-15.cpp)\n\n## 第23章 文本处理\n### 23.2 字符串\n* [字符串转换函数](ch23/string_convert.h)\n\n### 23.4 映射\n* 查找邮件\n  * [Message_file](ch23/email_message.h)\n  * [主程序](ch23/find_email.cpp)\n\n### 23.7 使用正则表达式搜索\n* [查找邮政编码](ch23/find_postal_codes.cpp)\n\n### 23.8 正则表达式语法\n#### 23.8.7 正则表达式错误\n* [测试正则表达式](ch23/test_regex.cpp)\n\n### 23.9 使用正则表达式匹配\n* [验证表格](ch23/verify_table.cpp)\n\n### 简单练习\n* [查找邮政编码](ch23/find_postal_codes.cpp)\n\n### 习题\n* [23-1](ch23/testdata/test.eml)\n* [23-2~23-4](ch23/find_email_v2.cpp)\n* [23-6](ch23/exec23-6.cpp)\n* [23-8](ch23/exec23-8.cpp)\n* [23-10](ch23/exec23-10.cpp)\n* [23-12](ch23/exec23-12.cpp)\n* [23-13](ch23/exec23-13.cpp)\n* [23-15~23-16](ch23/exec23-15.txt)\n\n## 第24章 数值计算\n### 24.2 大小、精度和溢出\n* [溢出和截断](ch24/overflow_and_truncation.cpp)\n\n#### 24.2.1 数值限制\n* [数值限制](ch24/numeric_limits.cpp)\n\n### 24.5 Matrix库\n* [矩阵示例](ch24/matrix_example.cpp)\n\n#### 24.5.1 维度和访问\n* [二维矩阵](ch24/two_dim_matrix.cpp)\n\n### 24.6 示例：解线性方程组\n* [高斯消元法](ch24/gaussian_elimination.cpp)\n* [主程序](ch24/solve_linear_equations.cpp)\n\n#### 24.6.3 测试\n* [解随机线性方程组](ch24/solve_random_system.cpp)\n\n### 24.7 随机数\n* [生成正态分布直方图](ch24/generate_normal_dist_histogram.cpp)\n\n### 简单练习\n* [24-1~24-3](ch24/drill24-1.cpp)\n* [24-4](ch24/drill24-4.cpp)\n* [24-5, 24-8](ch24/drill24-5.cpp)\n* [24-6](ch24/drill24-6.cpp)\n* [24-7](ch24/drill24-7.cpp)\n\n### 习题\n* [24-1~24-2](ch24/drill24-1.cpp)\n* [24-4](ch24/solve_linear_equations.cpp)\n* [24-5](ch24/testdata/solve_linear_equations_input6.txt)\n* [24-8](ch24/exec24-8.cpp)\n* [24-10](ch24/exec24-10.cpp)\n* [24-11](ch24/exec24-11.cpp)\n* [24-12](ch24/matrix_operation.h)\n\n# 术语\n[术语](terms.md)\n\n参考：[Bjarne Stroustrup's C++ Glossary](https://www.stroustrup.com/glossary.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzy979%2Fppp-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzy979%2Fppp-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzy979%2Fppp-code/lists"}