#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;

int main() {
    fstream picture_fp, rar_fp,output_fp;
    char data;
    string data2;
    char picture_filename[50], rar_filename[50], output_filename[50];
    cout << "Please input the picture name :" << endl;
    cin>>picture_filename;
    cout << "Please input the rar file name :" << endl;
    cin >> rar_filename;
    cout << "Please input the output file name :" << endl;
    cin >> output_filename;

    picture_fp.open(picture_filename, ios::in|ios::binary);
    if (!picture_fp.is_open()) {
        cout << "打开失败" << endl;
    }
    rar_fp.open(rar_filename, ios::in | ios::binary);
    if (!rar_fp.is_open()) {
        cout << "打开失败" << endl;
    }
    output_fp.open(output_filename, ios::out | ios::binary);
    while (!picture_fp.eof())
    {
        data=picture_fp.get() ;//读一个字符
        //picture_fp >> data2;//读一行
        output_fp << data;
    }
    picture_fp.close();
    while (!rar_fp.eof())
    {
        data=rar_fp.get() ;//读一行
        output_fp << data;
    }    
    rar_fp.close();
    output_fp.close();

    system("pause");
}

 

posted on 2019-07-15 01:04  一抹烟霞  阅读(250)  评论(0编辑  收藏  举报

Live2D