b****g 发帖数: 625 | 1 Suppose there is a platform where
sizeof(unsigned int) == 4
and the function app():
unsigned int app(unsigned int)
yields the following output:
app(0x80000000) == 1;
app(0x40000000) == 2;
app(3) == 0xc0000000;
app(0x70) == 0xe000000;
app(0x99999999) == 0x99999999
app(0xAAAAAAAA) == 0x55555555
app(app(x)) == x for all x.
Write a version of app() |
m*****g 发帖数: 226 | 2 dont get it.
if(argv[1]==xxx) return xxxx? |
n**x 发帖数: 30 | 3 把2进制各位倒过来。
拿计算器看看0x70和0xe000000的2进制表示。
【在 b****g 的大作中提到】 : Suppose there is a platform where : sizeof(unsigned int) == 4 : and the function app(): : unsigned int app(unsigned int) : yields the following output: : app(0x80000000) == 1; : app(0x40000000) == 2; : app(3) == 0xc0000000; : app(0x70) == 0xe000000; : app(0x99999999) == 0x99999999
|
w***i 发帖数: 9 | 4 就是算出二进制的逆序。
1000 0000 0000 0000 => 0000 0000 0000 0001
1100 0000 0000 0000 => 0000 0000 0000 0011
and so on....
【在 b****g 的大作中提到】 : Suppose there is a platform where : sizeof(unsigned int) == 4 : and the function app(): : unsigned int app(unsigned int) : yields the following output: : app(0x80000000) == 1; : app(0x40000000) == 2; : app(3) == 0xc0000000; : app(0x70) == 0xe000000; : app(0x99999999) == 0x99999999
|