第十六週閱讀程序3(1)

問題及代碼:

/*
*Copyright (c) 2016,煙臺大學計算機學院
*All rights reserved.
*文件名稱:zwj.cpp
*作    者:張偉晶
*完成日期:2016年6月17日
*版 本 號:v1.0
*
*問題描述:閱讀程序
*輸入描述:
*程序輸出:
*/
#include <iostream>
#include <fstream>
using namespace std;
int main( )
{
    unsigned char a[] = {0xD4,0xB8,0xB7,0xAD,0xD7,0xAA,0xB5,0xC4,0x43,0x2B,
                         0x2B,0xBF,0xCE,0xCC,0xC3,0xCE,0xAA,0xC4,0xE3,0xB4,
                         0xF8,0xC0,0xB4,0xD1,0xA7,0xCF,0xB0,0xB7,0xBD,0xB7,
                         0xA8,0xB5,0xC4,0xB8,0xC4,0xB1,0xE4,0xA3,0xA1
                        };
    ofstream outfile("f3.dat",ios::out|ios::binary);
    outfile.write((char*)a, sizeof(a));
    outfile.close();
    return 0;
}

運行結果:

知識點總結:

二進制轉換

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章