AP计算机科学原理课笔记
2022/10/3
高中大学选修计算机科学原理课(CSP)课堂笔记,仅作个人用途。
目录
AP考试语言
Assignment, Display, and Input
On the AP Exam | In Snap! | 备注 |
---|---|---|
a <- expression | - set a to expression |
a 是用户自定义的global variable |
DISPLAY (expression) | - say expression - think expression - write expression size n |
|
INPUT () | - ask expression and wait - answer |
Arithmetic Operators and Numeric Procedures
On the AP Exam | In Snap! | 备注 |
---|---|---|
a + b a - b a * b a / b |
- a + b - a - b - a x b - a / b |
|
a MOD b | - a mod b |
|
RANDOM (a, b) | - pick random a to b |
Relational and Boolean Operators
On the AP Exam | In Snap! | 备注 |
---|---|---|
a = b a ≠ b a > b a < b a ≥ b a ≤ b |
- a = b - a > b - a < b |
在Snap!中,≠、≥和≤符号并不存在 |