t("matnpat.dat");\rif(!matnpat)\r(\rcerr)"Can'topenpat.dat.\n";\rexit(l);\r)\rstringtemp;\rset<string>mats;\rwhile(getline(mat,temp))\rmats.insert(temp);\rostream_iterator<string,char>out(cout,"\n");\rcout)"Mat'sguestlist:\n";\rcopy(mats.begin(),mats.end(),out);\rset<string>pats;\rwhile(getline(pat,temp))\rpats.insert(temp);\rcout)”\nPat'sguestlist:\nn;\rcopy(pats.begin(),pats.endQ,out);\rostream_iterator<string,char>fout(matnpat,n\n");\rset<string>both;\rset_union(mats.begin(),mats.end(),pats.begin(),pats.end(),\rinsert_iterator<set<string>>(both,both.begin()));\rcout)n\nMergedguestlist:\nM;\rStephenPrata55July22,1999SampleSolutionsforProgrammingExercisesinC++\rPrimerPlus,3rdEditionStephenPrata56July22,1999\rcopy(both.begin(),both.end(),out);\rcopy(both.begin(),both.end(),fout);\rreturn0;