這題的核心就是找規律,多點例子給各位找應該沒問題 🤔
value | code |
---|---|
0 | 0 |
1 | 1 |
2 | 11 |
3 | 10 |
4 | 110 |
5 | 111 |
6 | 101 |
7 | 100 |
8 | 1100 |
9 | 1101 |
10 | 1111 |
11 | 1110 |
12 | 1010 |
13 | 1011 |
14 | 1001 |
15 | 1000 |
16 | 11000 |
17 | 11001 |
18 | 11011 |
19 | 11010 |
20 | 11110 |
21 | 11111 |
22 | 11101 |
23 | 11100 |
24 | 10100 |
25 | 10101 |
26 | 10111 |
27 | 10110 |
28 | 10010 |
29 | 10011 |
30 | 10001 |
31 | 10000 |
32 | 110000 |
33 | 110001 |
34 | 110011 |
35 | 110010 |
36 | 110110 |
37 | 110111 |
38 | 110101 |
39 | 110100 |
40 | 111100 |
41 | 111101 |
42 | 111111 |
43 | 111110 |
44 | 111010 |
45 | 111011 |
46 | 111001 |
47 | 111000 |
48 | 101000 |
49 | 101001 |
50 | 101011 |
51 | 101010 |
52 | 101110 |
53 | 101111 |
54 | 101101 |
55 | 101100 |
56 | 100100 |
57 | 100101 |
58 | 100111 |
59 | 100110 |
60 | 100010 |
61 | 100011 |
62 | 100001 |
63 | 100000 |