{"id":22965766,"url":"https://github.com/mirror4s/introductory-c-programming-specialization","last_synced_at":"2026-06-23T17:32:33.588Z","repository":{"id":199726497,"uuid":"703437450","full_name":"MirRoR4s/Introductory-C-Programming-Specialization","owner":"MirRoR4s","description":"杜克大学 C 编程入门","archived":false,"fork":false,"pushed_at":"2024-02-03T08:45:19.000Z","size":344,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T06:47:50.078Z","etag":null,"topics":["c","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Python","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/MirRoR4s.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":"2023-10-11T08:42:58.000Z","updated_at":"2024-02-03T08:57:47.000Z","dependencies_parsed_at":"2025-04-02T04:27:34.361Z","dependency_job_id":"4923cec1-5e8a-4a06-bda3-e5fef795edeb","html_url":"https://github.com/MirRoR4s/Introductory-C-Programming-Specialization","commit_stats":null,"previous_names":["mirror4s/introductory-c-programming-specialization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MirRoR4s/Introductory-C-Programming-Specialization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirRoR4s%2FIntroductory-C-Programming-Specialization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirRoR4s%2FIntroductory-C-Programming-Specialization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirRoR4s%2FIntroductory-C-Programming-Specialization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirRoR4s%2FIntroductory-C-Programming-Specialization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MirRoR4s","download_url":"https://codeload.github.com/MirRoR4s/Introductory-C-Programming-Specialization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MirRoR4s%2FIntroductory-C-Programming-Specialization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34700906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","programming-language"],"created_at":"2024-12-14T20:16:22.824Z","updated_at":"2026-06-23T17:32:33.570Z","avatar_url":"https://github.com/MirRoR4s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 学习总结\n\n## 前言\n\n课程共分四个部分，第一个部分主讲编程基础，不涉及到具体的编写代码，从第二个部分开始才真正上手编写代码。\n\n地址：\u003chttps://www.coursera.org/specializations/c-programming\u003e\n\n---\n\n## [Programming Fundamentals](https://www.coursera.org/learn/programming-fundamentals/home/week/1)\n\n### 第一周\n\n#### How to Write a Progarm with the Seven Steps\n\n本部分主要阐述先计划后编码的思想，强调不要上来就直接开始写代码，而是要利用七步法来做。\n\n七步法编写代码步骤如下：\n\n1. 手工求解问题的特定实例\n2. 具体地写下为求解该实例所做的事情\n3. 尝试将所做之事归纳成算法\n4. 用其他不同的实例测试一下算法的正确性\n5. 将算法转换成代码\n6. 测试代码的正确性\n7. 如果代码不对则进行调试\n\n\u003e 值得注意的是，如果某个步骤发现了错误，可能要回到之前所做的步骤。\n\n如果发现自己没办法手工求解问题的特定实例怎么办？这一部分给出了产生这个问题的原因：\n\n- 问题本身不够明确，此时应询问相关的人\n- 缺乏为求解该问题所需的相关领域知识，比如判断7是否为素数要求我们具备数学领域的知识（素数的定义）\n\n---\n\n#### The First Four Steps\n\n这一部分具体地阐述了七步法的前四步应该怎样做，以一个计算 3^4 为例子一步步描述如何实践七步法的前四个步骤。本部分讲到归纳成算法时重点观察解决问题的过程中重复的那一部分，这可能对应着算法的模式。有的时候重复可能并不完全，这时候我们要做一些细微地调整以消除重复不完全的部分。\n\n如果未能发现算法的模式从而不能归纳出算法怎么办？那就回到步骤1、2试着手工求解更多实例。\n\n最后本部分还给出了一个简单的小测验，主要考察我们对七步法的理解，比如在特定步骤发生了问题应该怎样解决等等。\n\n---\n\n#### Examples\n\n本部分列举了两个算法：\n\n1. 网格方块颜色填充：在不同的位置以一定地规律填充不同颜色的方块，填充规律就是要归纳出来的算法。我们通过明确地写下方块的坐标、要填充的颜色从而不断地进行填充，之后通过观察坐标发现填充的规则是当坐标和为 3 的倍数时填充蓝色，否则填充红色。\n2. 求最短点距：给定一点集 S 和一点 P，希望归纳出一个算法求出 S 中和 P 距离最近的点。归纳此算法需要特定领域知识即知晓如何求解两点距离。在归纳的过程中，我们通过不断地手工求解两点间的距离，并比较这些距离以找出最近点，有了这个过程，归纳出算法是自然而然的。\n\n最后，我们进行了一个算法练习：\n\n- 给定数字序列1，求出其生成算法：找出项数、序列第一个数和项数n的关系即可。\n- 给定网格并在其上填充不同颜色的方块，求出填充算法：把坐标和对应的颜色写下来，然后观察一下红色方块的绘制变化以及我们写下来的内容，即可发现规律是从0到n（包括）记为 x，再从 0 到 n+1（包括）记为 y，在 (x, y) 处绘制红色方块即可。最后当 n 是偶数时在 (n+1, n+1) 处绘制绿色方块，否则在 (n+2, n) 和 (n+2, n+2) 处绘制蓝色方块。\n- 给定数字序列2，求出其生成算法：序列包含的数字个数显然是 n * 2，并观察到首个数字都是 0。观察数字序列，将其分为前后两部分，每部分含有相同数字，那么可以发现从0开始，每次加2，一共持续 n 次可得到前半部分，之后从 n 开始每次加一，再持续 n 次，可得后半部分。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirror4s%2Fintroductory-c-programming-specialization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirror4s%2Fintroductory-c-programming-specialization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirror4s%2Fintroductory-c-programming-specialization/lists"}