#include "iostream"
#include "fstream"
#include "windows.h"
#include "string"
using namespace std;
int main()
{
ifstream in("C:\\操作.txt",ios::binary);
if (!in.is_open())
{
cout<<"打开失败!"<<'\n';
}
else
{
ofstream out("C:\\写入9.txt",ios::binary);
if (!out.is_open())
{
cout<<"打开文件失败!"<<'\n';
}
else
{
cout<<"打开文件成功!"<<'\n';
char str[256];
while(!in.eof())
{
in.getline(str,256);
out<<str<<endl;
}
out.close();
}
}
system("pause");
return 0;
}