#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
ofstream outfile("D:\\C++.txt");
if(!outfile)
{
cout<<"file can't open.\n";
exit(0);
}
outfile<<"this is a program.\n";//这里单词你给它空多少距离,存储的文件中也就空多少距离了
outfile<<"\nok!";
outfile.close();
system("pause");
return 0;
}
看球了