写入txt

#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;

int main()
{

ofstream fs("123.txt",ios::app);

fs<<setw(7)<<"234234"<<setw(3)<<"12"<<endl;

system("pause");
return 0;
}
原文地址:https://www.cnblogs.com/tiandsp/p/2334903.html