1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void main ()
{
char FirstName ,LastName,Gender,Relation,enter;
ifstream inputfile;
inputfile.open("FF.txt");
if (!inputfile)
cout<< "Error opening file.\n";
else
inputfile>>FirstName>>LastName>>Gender>>Relation;
while (!inputfile.eof())
{
if (Relation =='f','r','i','e','n','d')
cout<<FirstName ,LastName;
}
cout<<"press enter\n";
cin>>enter;
inputfile.close();
ifstream inputfile;
inputfile.open("FF.txt");
if (!inputfile)
cout<< "Error opening file.\n";
else
inputfile>>FirstName>>LastName>>Gender>>Relation;
while (!inputfile.eof())
{
if (Relation=='r','e','l','a','t','i','v','e')
{
cout<<FirstName ,LastName;
}
cout<<"press enter\n";
cin>>enter;
inputfile.close();
}
inputfile>>FirstName>>LastName>>Gender>>Relation;
while (!inputfile.eof())
{
ofstream outfile;
outfile.open(FirstName+" "+LastName);
outfile << endl << "To"<<FirstName<<" "<<LastName<<endl<<"would like to invite you to my birthday party at 7pm on __________ at ___________.I hope you can come."<<endl<<"I will be really excited to see you in my party."<<endl<<"Sincerely yours,"<<endl<<"Your name";
outfile.close();
}
}
|