- 最後登錄
- 2024-5-25
- 在線時間
- 29002 小時
- 註冊時間
- 2011-12-11
- 閱讀權限
- 95
- 精華
- 3
- UID
- 10643381
- 帖子
- 3224
- 積分
- 24366 點
- 潛水值
- 77430 米
| 如果你忘記伊莉的密碼,請在登入時按右邊出現的 '找回密碼'。輸入相關資料後送出,系統就會把密碼寄到你的E-Mail。 - #include <cstdio>
- #include <cstdlib>
- using namespace std;
- void Conv(const char* str1 , const char* str2)
- {
- int result = 0;
- int i = 0;
-
- do
- {
- result <<= 1;
- result |= (str1[i++] == 'X');
- }while(i < 8);
-
- print f("0x%02x , " , result);
-
- result = 0 , i = 0;
- do
- {
- result <<= 1;
- result |= (str2[i++] == 'X');
- }while(i < 8);
- print f("0x%02x\n" , result);
- }
- int main()
- {
- Conv("_____XX_" , "________");
- Conv("_____X__" , "____X___");
- Conv("_XXXXXXX" , "XXXXXX__");
- system("pause");
- return 0;
- }
複製代碼 ... |
|