#include
#include
#include
int main()
{
using namespace std;
ifstream in_stream;
ofstream out_stream;
in_stream.open("infile.txt");
if(in_stream.fail())
{
cout<<"input file opening failed.\n";
exit(1);
}
out_stream.open("outfile.txt");
if(out_stream.fail())
{
cout<<"output file opening failed.\n";
exit(1);
}
int first,second,third;
in_stream>>first>>second>>third;
out_stream<<"The sum of the first 3 \n"
<<"number in infile.dat\n"
<<"is"<<(first+second+third)
<<endl;
in_stream.close();
out_stream.close();
return 0;
}

