24点挑战|1, 3, 4, 6|HACKING: The Art of Exploitation
这不是一道普通的 24 点题。这是一本“黑客圣经”里的例题。
—— Jon Erickson 所著《HACKING: The Art of Exploitation(第二版)》中写道:
The essence of hacking is finding unintended or overlooked uses for the laws and properties of a given situation and then applying them in new and inventive ways to solve a problem—whatever it may be.
The following math problem illustrates the essence of hacking:
Use each of the numbers 1, 3, 4, and 6 exactly once with any of the four basic math operations (addition, subtraction, multiplication, and division) to total 24.
Each number must be used once and only once, and you may define the order of operations; for example, 3 * (4 + 6) + 1 = 31 is valid, however incorrect, since it doesn’t total 24.
中文翻译如下:
“黑客的精髓,是在规则之中,发现那些被忽略的路径,运用那些意想不到的可能性,解决问题——无论问题是什么。”
下面这道数学题,正体现了黑客精神:
请使用数字 1、3、4、6 各一次,结合加减乘除四则运算,使结果为 24。
每个数字只能使用一次,括号的顺序可以自由安排。
比如:3 × (4 + 6) + 1 = 31 是合法的表达式,但不是正确答案。
——
我第一次看到这题,是在多年前读这本书的时候。书中讲的是底层内存操作、缓冲区溢出、系统漏洞,而它开篇却丢出这样一道数学题。
我当时愣住了:这居然是一本黑客书的第一章?
但也就是那一刻,我才明白:真正的黑客,不是“键盘侠”,而是规则的艺术家。