#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <iterator>
#include <vector>
#include <fstream>
using namespace std;
int main()
{
string input_file_name;
string output_file_name;
cout<<"input the in_file_name: "<<endl;
cin>>input_file_name;
cout<<"input the output_file_name: "<<endl;
cin>>output_file_name;
ifstream f_in(input_file_name.c_str());
ofstream f_out(output_file_name.c_str());
if(!f_in || !f_out)
{
cout<<"can't open the file!"<<endl;
exit(0);
}
istream_iterator<char> is(f_in);
istream_iterator<char> eof;
vector<char> text;
copy(is,eof,back_inserter(text));
ostream_iterator<char> os(f_out,"");
copy(text.begin(),text.end(),os);
cout<<"the copy is over ! "<<endl;
return 0;
}