c++ txt格式的写入(转)

//c++ 输出 txt文件
#include <iostream>
#include <fstream>

using namespace std;

int main(int argc, const char* argv[])
{
    ofstream out("RGB.txt");
    for (int i = 1; i <= 30; i++)
    {
        out << "RGB/" << i << ".jpg" << endl;
    }
    out.close();
    printf(" end! \n");
    return 0;
}


posted on 2022-11-09 15:43  混元真人  阅读(204)  评论(0)    收藏  举报