内容 2.1 Introduction to Data Abstraction · 79
练习 自检推理
Exercise 2.5: Show that we can represent pairs of
nonnegative integers using only numbers and arithmetic operations if we
represent the pair a and b as the integer that is the product 2
a
3
b.
Give the corresponding definitions of the procedures cons,
car, and cdr.
练习 2.5:证明我们可以仅用数和算术运算表示非负整数的序对——将序对 a 与 b 表示为整数 2^a × 3^b。给出过程 cons、car 和 cdr 的相应定义。
我的笔记 自动保存