C++常用小工具……

时间:2014-05-13 22:29:37   收藏:0   阅读:458

1. 批量改变文件内容:

bubuko.com,布布扣
//批量改变输出文件内容
#include <fstream>
#include <iostream>
#include <string>

using namespace std;

int main(){
    ifstream input("D:pos_img.txt");
    ofstream output("D:pos_image_o.txt");
    string strin,strout;
    while(input>>strin){
        strout ="pos_image/"+strin;
        strout+=" 1 0 0 40 40";
        output<<strout<<endl;
    }
    return 0;
}
bubuko.com,布布扣

效果如图:

      改前                                    改后

bubuko.com,布布扣bubuko.com,布布扣

C++常用小工具……,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!