mats;\rwhile(getline(mat,temp))\rmats.insert(temp);\rostream_iteratorout(cout,"\n");\" /> mats;\rwhile(getline(mat,temp))\rmats.insert(temp);\rostream_iteratorout(cout,"\n");\" />

全文预览

C++Primer源代码

上传者:火锅鸡 |  格式:pdf  |  页数:76 |  大小:9030KB

文档介绍
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;

收藏

分享

举报
下载此文档