0、一些资源链接
原视频:https://www.youtube.com/playlist?list=PLhQjrBD2T380hlTqAU8HfvVepCcjCqTg6
逐字文稿+思维导图(思维导图需要复制粘贴到 https://markmap.js.org/repl 在线实时渲染)
通过网盘分享的文件:CS50x 2026 Lectures 链接: https://pan.baidu.com/s/1_3gi40KuRKGGlo0OUVHrFQ?pwd=epg4 提取码: epg4
作业链接:https://www.learncs.site/docs/curriculum-resource/cs50x/cs50x_zh
1、Lecture0 Scratch 编程入门
讲了一些编码的知识,在计算机的世界里面只有0和1,但是通过多个0 1的组合,可以用来指代各种各样的东西。甚至还有颜色、大小、样式这些。不同复杂组合的0 1还能指代print、加减乘除这些稍复杂的操作。
然后用了个电话本找人号码的例子,讲了怎么去找一个人的电话号码,引入到了函数的概念。其实就是简单的二分法,把书一撕两半,然后问这个人在哪一半书里面,以此降低复杂度和提高寻找速度。
tedious:繁琐的
提到了scratch这个编程平台,有点像小孩子玩的少儿编程。其实就是帮助引入变量、函数、判断、循环等等概念以及他们的功能。

2、C
2.1 编译
2026.8.13
#include<stdio.h>
int main(void)
{
printf("hello,world\n");
}
比如我们有这样的C代码,想要运行他有几个办法
- 使用gcc编译,
gcc hello.c -o hello就是将 hello.c 编译成可执行文件 hello.exe
gcc hello.c -o hello
.\hello
- 使用make
choco install make
code hello.c
make hello
- 创建Makefile
hello: hello.c
gcc hello.c -o hello
clean:
rm hello.exe
#编译和运行
make hello
.\hello
#清理编译文件
make clean
最后使用./hello,注意不是hello
然后使用到一个python里面类似的input函数,从文件所在文件夹下找的,cs50.h,文件来自https://github.com/cs50/libcs50.git。
#include<stdio.h>
#include "cs50.h"
int main(void)
{
string answer = get_string("What is your name? ");
printf("hello, %s\n", answer);
}
gcc hello.c cs50.c -o hello
<xxx.h>:系统 include 路径(mingw 安装目录下 include 文件夹)"xxx.h":先搜索当前源码所在文件夹,找不到再去系统路径。
2.2 条件 conditions
if else if else
2.3 types与占位符
bool:布尔值
char:字符串,%c表示单个字符
double:双精度浮点数,64位。
float:浮点数,即带有小数点的数字,一般32位,32位可以表示约40亿个浮点数。%f
int:32位,正负21亿左右。%i
long:64位,%li