[問題] 幾個很簡單的問題(rotate shift)

看板C_and_CPP (C/C++)作者 (康妮)時間16年前 (2009/08/13 15:27), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
題目是這樣 使用者輸入一串(如下) 所使用的是16進位 number range 是 0*00 到 0*ffffffff 1. type in an expression: 49 add 41 (相加) the answer: 8a 2. type in an expression: 2a xor 7d the answer is:57 3. type in an expression:49 ror 10 (rotate 數字49 10bits) the answer is :490000 (為什麼不是49000000) 4. type in an expression:49 shiftleft 10 (移動數字49 往左10bits) the answer is :??(不知道) 5. type in an expression:80000002 asr 1 (不太懂asr是甚麼意思,上面寫是 arithmatic shift right) the answer is :c0000001 有問題的是3.4.5題(跑出來答案都不對) 謝謝!!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 202.74.208.168
文章代碼(AID): #1AWy1D9U (C_and_CPP)
文章代碼(AID): #1AWy1D9U (C_and_CPP)