CS50 编程术语发音指南
CS50 Programming Terms - Pronunciation Guide
完整发音指南(适用于 Text-to-Speech)
📢 使用说明
为 Gemini TTS 优化的发音文本:
- ✅ 每个术语后都有拼读版本(TTS 会读得更准确)
- ✅ 包含示例句子供 TTS 朗读
- ✅ 符号和代码的口语化表达
1️⃣ 基础编程术语
Algorithm
拼读: AL-go-rith-um
TTS文本: “algorithm”
例句: “The greedy algorithm makes the best choice at each step.”
Function
拼读: FUNK-shun
TTS文本: “function”
例句: “We need to define a function to calculate the average.”
Variable
拼读: VAIR-ee-uh-bul
TTS文本: “variable”
例句: “Store the user’s input in a variable called height.”
Integer
拼读: IN-tuh-jer
TTS文本: “integer”
例句: “An integer is a whole number without decimals.”
Array
拼读: uh-RAY
TTS文本: “array”
例句: “An array is a collection of elements stored in memory.”
Loop
拼读: LOOP
TTS文本: “loop”
例句: “We use a for loop to iterate through each row.”
Iterate
拼读: IT-er-ate
TTS文本: “iterate”
例句: “Let’s iterate through the array from start to finish.”
2️⃣ CS50 特定术语
Greedy Algorithm
拼读: GREE-dee AL-go-rith-um
TTS文本: “greedy algorithm”
例句: “The greedy algorithm always chooses the largest coin first.”
Luhn’s Algorithm
拼读: LOONZ AL-go-rith-um
TTS文本: “Loon’s algorithm”
音标: /luːnz/
例句: “Luhn’s algorithm is used to validate credit card numbers.”
Modulo
拼读: MOD-yoo-loh
TTS文本: “modulo” or “mod”
例句: “Ninety-two modulo twenty-five equals seventeen.”
Abstraction
拼读: ab-STRAK-shun
TTS文本: “abstraction”
例句: “Function abstraction helps us organize complex code.”
Checksum
拼读: CHECK-sum
TTS文本: “checksum”
例句: “A checksum is used to verify data integrity.”
3️⃣ C 语言关键字
printf
拼读: print-eff
TTS文本: “print f” 或 “printf”
例句: “Use printf to output text to the console.”
scanf
拼读: scan-eff
TTS文本: “scan f” 或 “scanf”
例句: “The scanf function reads input from the user.”
int main void
读法: int main void
TTS文本: “int main void”
例句: “Every C program starts with int main void.”
include
拼读: in-KLOOD
TTS文本: “include”
例句: “We include standard libraries at the top of our program.”
return
拼读: ree-TURN
TTS文本: “return”
例句: “The function should return zero when successful.”
4️⃣ 数据类型发音
char
拼读: care 或 char (like “character”)
TTS文本: “char” or “care”
例句: “A char variable stores a single character.”
float
拼读: FLOAT
TTS文本: “float”
例句: “Use float for numbers with decimal points.”
double
拼读: DUH-bul
TTS文本: “double”
例句: “Double precision floating point numbers are more accurate.”
long
拼读: LONG
TTS文本: “long”
例句: “Use long for very large integers.”
bool / boolean
拼读: BOOL / BOO-lee-un
TTS文本: “bool” / “boolean”
例句: “A boolean value is either true or false.”
5️⃣ 运算符和符号(口语化表达)
Arithmetic Operators
+
读法: “plus” or “add”
例句: “x plus y” or “add x and y”
TTS: “x plus y equals z”
-
读法: “minus” or “subtract”
例句: “x minus y” or “subtract y from x”
TTS: “x minus y equals ten”
*
读法: “times” or “multiply” or “asterisk”
例句: “x times y” or “x multiplied by y”
TTS: “x times y equals twelve”
/
读法: “divided by” or “slash”
例句: “x divided by y”
TTS: “ninety-two divided by twenty-five equals three”
%
读法: “modulo” or “mod” or “remainder”
例句: “x mod y” or “x modulo y”
TTS: “ninety-two mod twenty-five equals seventeen”
Comparison Operators
==
读法: “equals” or “is equal to” or “double equals”
例句: “if x equals five”
TTS: “if x double equals five”
注意: 与赋值的 = 区分
!=
读法: “not equal to” or “not equals”
例句: “while x not equals zero”
TTS: “while x not equals zero”
<
读法: “less than”
例句: “if x less than y”
TTS: “if x is less than y”
<=
读法: “less than or equal to”
例句: “while i less than or equal to ten”
TTS: “while i is less than or equal to ten”
>
读法: “greater than”
例句: “if x greater than zero”
TTS: “if x is greater than zero”
>=
读法: “greater than or equal to”
例句: “while count greater than or equal to five”
TTS: “while count is greater than or equal to five”
Logical Operators
&&
读法: “and” or “logical and” or “double ampersand”
例句: “if x is positive and y is positive”
TTS: “if x greater than zero and y greater than zero”
||
读法: “or” or “logical or” or “double pipe”
例句: “if x equals five or x equals ten”
TTS: “if x equals five or x equals ten”
!
读法: “not” or “exclamation mark” or “bang”
例句: “if not valid”
TTS: “if not valid”
Assignment and Compound Operators
=
读法: “equals” or “is assigned” or “gets”
例句: “x equals five” or “x gets five”
TTS: “x equals five” or “assign five to x”
+=
读法: “plus equals” or “add and assign”
例句: “x plus equals five”
TTS: “x plus equals five” or “add five to x”
-=
读法: “minus equals” or “subtract and assign”
例句: “count minus equals one”
TTS: “count minus equals one”
*=
读法: “times equals” or “multiply and assign”
例句: “dollars times equals two”
TTS: “dollars times equals two”
/=
读法: “divided equals” or “divide and assign”
例句: “total divided equals count”
TTS: “total divided equals count”
%=
读法: “mod equals” or “modulo equals”
例句: “remainder mod equals ten”
TTS: “remainder mod equals ten”
Increment/Decrement
++
读法: “plus plus” or “increment”
例句: “i plus plus” or “increment i”
TTS: “i plus plus”
--
读法: “minus minus” or “decrement”
例句: “i minus minus” or “decrement i”
TTS: “i minus minus”
6️⃣ 括号和标点符号
()
名称: Parentheses
读法: “open paren… close paren” or “in parentheses”
例句: “for open paren int i equals zero close paren”
TTS: “for, open parenthesis, int i equals zero, close parenthesis”
{}
名称: Braces / Curly braces
读法: “open brace… close brace” or “curly braces”
例句: “open brace, printf hello, close brace”
TTS: “open curly brace, print f hello, close curly brace”
[]
名称: Brackets / Square brackets
读法: “open bracket… close bracket” or “square brackets”
例句: “scores open bracket i close bracket”
TTS: “scores, open bracket, i, close bracket”
或: “scores sub i” (数组下标的简化读法)
;
名称: Semicolon
读法: “semicolon”
例句: “printf hello semicolon”
TTS: “print f hello, semicolon”
注意: 在朗读代码时通常省略
,
名称: Comma
读法: “comma”
例句: “printf, open paren, percent i comma x, close paren”
TTS: “print f, open paren, percent i, comma, x, close paren”
.
名称: Period / Dot
读法: “dot” or “period”
例句: “three dot one four one five nine”
TTS: “three point one four one five nine”
7️⃣ 特殊字符和转义序列
\n
读法: “backslash n” or “newline”
例句: “printf hello backslash n”
TTS: “print f hello, backslash n” or “print f hello, new line”
\t
读法: “backslash t” or “tab”
例句: “backslash t for tab”
TTS: “backslash t for tab”
\0
读法: “backslash zero” or “null terminator”
例句: “strings end with backslash zero”
TTS: “strings end with backslash zero, the null terminator”
#
读法: “hash” or “pound sign” or “number sign”
例句: “hash include stdio dot h”
TTS: “hash include standard i o dot h”
//
读法: “double slash” or “comment”
例句: “double slash this is a comment”
TTS: “double slash, this is a comment”
/* */
读法: “slash star… star slash” or “block comment”
例句: “slash star, this is a block comment, star slash”
TTS: “slash star, this is a block comment, star slash”
8️⃣ 数学表达式朗读
完整代码行示例
Example 1:
代码: int x = 5;
朗读: “int x equals five, semicolon”
TTS文本: “int x equals five”
Example 2:
代码: for (int i = 0; i < height; i++)
朗读: “for, open paren, int i equals zero, semicolon, i less than height, semicolon, i plus plus, close paren”
TTS文本: “for loop, int i equals zero, while i is less than height, increment i”
Example 3:
代码: printf("%i\n", x / y);
朗读: “printf, open paren, quote percent i backslash n quote, comma, x divided by y, close paren, semicolon”
TTS文本: “print f, percent i, new line, x divided by y”
Example 4:
代码: if (x >= 1 && x <= 8)
朗读: “if, open paren, x greater than or equal to one, and, x less than or equal to eight, close paren”
TTS文本: “if x is greater than or equal to one, and x is less than or equal to eight”
Example 5:
代码: coins += cents / 25;
朗读: “coins plus equals cents divided by twenty-five”
TTS文本: “coins plus equals, cents divided by twenty-five”
Example 6:
代码: cents %= 25;
朗读: “cents mod equals twenty-five”
TTS文本: “cents modulo equals twenty-five”
9️⃣ 数字的朗读方式
整数
0→ “zero”1→ “one”10→ “ten”100→ “one hundred”1000→ “one thousand”4294967295→ “four billion, two hundred ninety-four million, nine hundred sixty-seven thousand, two hundred ninety-five”
小数
3.14→ “three point one four”0.25→ “zero point two five” or “point two five”1.5→ “one point five”
分数(在解释中)
1/2→ “one half” or “one over two” or “one divided by two”3/4→ “three quarters” or “three over four”cents / 25→ “cents divided by twenty-five”
百分比
92 % 10→ “ninety-two mod ten” (注意:这里的%是模运算,不是百分比)50%→ “fifty percent”
🔟 格式化字符串占位符
%c
读法: “percent c”
说明: character
例句: “Use percent c to print a character”
TTS: “Use percent c to print a character”
%s
读法: “percent s”
说明: string
例句: “Use percent s to print a string”
TTS: “Use percent s to print a string”
%i or %d
读法: “percent i” or “percent d”
说明: integer / decimal
例句: “Use percent i to print an integer”
TTS: “Use percent i to print an integer”
%f
读法: “percent f”
说明: float
例句: “Use percent f to print a floating-point number”
TTS: “Use percent f to print a floating point number”
%li
读法: “percent l i” or “percent long i”
说明: long integer
例句: “Use percent long i for long integers”
TTS: “Use percent l i for long integers”
%.2f
读法: “percent dot two f”
说明: float with 2 decimal places
例句: “Use percent dot two f to print with two decimal places”
TTS: “Use percent dot two f to print with two decimal places”
1️⃣1️⃣ 常见编程术语句子
完整示例(适合 TTS 朗读)
Declaring Variables
"Let's declare an integer variable called height."
"We assign the value five to x."
"The variable stores the user's input."
Loops
"This for loop iterates from zero to height minus one."
"The outer loop controls the rows."
"The inner loop prints the hashes."
"We increment i after each iteration."
Conditions
"If x is less than y, print x is smaller."
"While the number is greater than zero, continue the loop."
"Use a do-while loop to ensure the code runs at least once."
Functions
"This function takes two parameters: length and array."
"The function returns an integer value."
"We call the function with two arguments."
"Don't forget to declare the function prototype."
Arrays
"Create an array of three integers."
"Access the first element using index zero."
"Arrays are zero-indexed in C."
"The array is stored in contiguous memory."
1️⃣2️⃣ 易混淆的发音对比
equals (=) vs. equals (==)
x = 5→ “x equals five” or “x gets five” (assignment)x == 5→ “x is equal to five” or “x double-equals five” (comparison)
Divide (/) vs. Modulo (%)
10 / 3→ “ten divided by three equals three”10 % 3→ “ten mod three equals one”
Increment (++) vs. Add (+=)
i++→ “increment i” or “i plus plus”i += 1→ “i plus equals one”
And (&&) vs. Ampersand (&)
x && y→ “x and y” (logical AND)&x→ “address of x” (pointer, Week 4)
Or (||) vs. Pipe (|)
x || y→ “x or y” (logical OR)x | y→ “x bitwise or y” (bitwise operation)
1️⃣3️⃣ 完整代码段朗读示例
Example: Mario Loop
代码:
for (int i = 0; i < height; i++)
{
for (int j = 0; j < i + 1; j++)
{
printf("#");
}
printf("\n");
}
正式朗读(逐字):
for open parenthesis int i equals zero semicolon i less than height semicolon
i plus plus close parenthesis
open curly brace
for open parenthesis int j equals zero semicolon j less than i plus one
semicolon j plus plus close parenthesis
open curly brace
printf open parenthesis quote hash quote close parenthesis semicolon
close curly brace
printf open parenthesis quote backslash n quote close parenthesis semicolon
close curly brace
自然朗读(讲解式):
For loop: initialize i to zero, while i is less than height, increment i.
Inside the outer loop, we have another for loop: initialize j to zero, while j
is less than i plus one, increment j.
In the inner loop, print a hash symbol.
After the inner loop, print a newline.
TTS 推荐版本(平衡):
For loop, int i equals zero, while i less than height, increment i.
Open brace.
Nested for loop, int j equals zero, while j less than i plus one, increment j.
Open brace.
Print a hash.
Close brace.
Print new line.
Close brace.
1️⃣4️⃣ TTS 优化建议
✅ DO(推荐):
- 使用完整单词: “equals” 而不是 “=”
- 添加停顿: 用逗号和句号控制节奏
- 自然语言: “while i is less than ten” 而不是 “while i < 10”
- 明确说明: “open parenthesis” 而不只是 “(“
❌ DON’T(避免):
- 符号堆砌: 不要说 “( i < 10 )”
- 过度简化: 不要跳过重要的符号
- 混合中英文: TTS 可能读错
- 过长句子: 一次说太多会难以理解
1️⃣5️⃣ 分类练习列表
Level 1: 基础术语(先练这些)
algorithm, function, variable, integer, array, loop, string
Level 2: 运算符(重点练习)
plus, minus, times, divided by, modulo, equals, not equals
less than, greater than, and, or, not
Level 3: 代码关键字
int, char, float, double, long, bool
if, else, while, for, do, return
printf, scanf, include
Level 4: 复杂表达式
"for int i equals zero, while i less than n, increment i"
"if x is greater than or equal to zero and x is less than ten"
"coins plus equals cents divided by twenty-five"
📱 使用 Gemini TTS 的具体步骤
方法 1: 在线测试
- 访问 Google Cloud Text-to-Speech Demo
- 选择语言: English (United States)
- 选择声音: en-US-Neural2-D (男声) 或 en-US-Neural2-F (女声)
- 粘贴本文档中的 TTS文本 或 例句
- 点击 “Speak” 听发音
方法 2: 使用 Gemini API
# 示例代码(如果你想写脚本)
import google.generativeai as genai
text = "For loop, int i equals zero, while i is less than height, increment i"
# 使用 TTS 功能转换为语音
方法 3: 使用浏览器扩展
- Chrome: Read Aloud, Natural Reader
- Edge: 内置的”大声朗读”功能
- 直接朗读本文档内容
🎯 练习建议
Day 1-2: 基础术语
- 听并跟读 Level 1 的所有术语
- 每个词重复 10 遍
- 录音对比
Day 3-4: 运算符
- 听并跟读 Level 2 的运算符
- 练习完整句子
- 用 TTS 验证发音
Day 5-6: 代码朗读
- 朗读 Section 8 的完整代码示例
- 先看文字,再听 TTS,最后自己读
- 录音并检查
Day 7: 综合练习
- 用本指南朗读你自己的代码
- 练习”自然朗读”风格(适合讲解)
- 准备好进入 Role Play Script
✨ 总结
最重要的发音规则:
- 符号要说出来:
<是 “less than”,不能跳过 - 区分赋值和比较:
=vs== - 逻辑运算符要清晰:
&&是 “and”,||是 “or” - 数字要完整: 不要说 “nine two”,要说 “ninety-two”
练习优先级:
- ⭐⭐⭐ 运算符(最常用)
- ⭐⭐⭐ 数据类型和关键字
- ⭐⭐ 完整代码行
- ⭐ 复杂嵌套结构
准备好后,就可以开始使用 Role Play Script 了!🎓