#include<string>
#include<fstream>
using namespace std; void main()
{
ifstream ifile;
ofstream ofile;
ifile.open("yourfile.txt");
ofile.open("result.txt");
int i=0;
string str;
while(i!=5)
{
getline(ifile,str);
ofile<<str<<endl;
i++;
}
ifile.close();
ofile.close();
}