#include #include #include #include using namespace std; class error {public: string err; error(string &d) {err = d;}; ~error() {} }; int compare(listl1,listl2) {list::iterator li; string s1="",s2=""; for(li=l1.begin();li!=l1.end();li++) s1+=*li; for(li=l2.begin();li!=l2.end();li++) s2+=*li; return s1.compare(s2); } bool add(listl1,listl2) {list_1,_2; _1=l1;_2=l2; _1.sort(); _2.sort(); return ((compare(l1,_1)==0)&&(compare(l2,_2)==0)); } int main() {int stop,u; // char *a1="Error boundaries not matching in first list"; vectorv; string temp="Chapter",s1="Error boundaries not matching in first list",s2="Error boundaries not matching in second list"; vector::iterator vi; error e(s1); v.reserve(15); v.push_back("Chapter"); v.push_back("Times that value is repeated to form the content of the container object."); v.push_back("Member type size_type is an unsigned integral type."); v.push_back("Chapter"); v.push_back("Value to be repeated n times as the content of the container object."); v.push_back("T is the first class template parameter (the type of the elements stored in the vector)."); v.push_back("Chapter"); v.push_back("Input iterators to the initial and final positions in a sequence. The range used is [first,last), which includes all the elements between first and last, including the element pointed by first but not the element pointed by last."); v.push_back("The function template type can be any type of input iterator."); v.push_back("Chapter"); v.push_back("Another vector object with the same class template parameters (T and Allocator)."); u=0; vi=v.begin(); while(vip[u]; list::iterator il; list::iterator nl ; vi=v.begin(); vi++; for(int k=0;k t1,t2; t1.push_back("a"); t1.push_back("d"); t1.push_back("e"); t1.push_back("f"); t2.push_back("t"); t2.push_back("c"); t2.push_back("g"); t2.push_back("h"); if (add(t1,t2)) t1.merge(t2); cout<<"Enter i,n"; int i,n; cin>>i; cin>>n; il=t1.begin(); nl=t2.begin(); for(int j=0;jt1.size())){ throw e(s1);} if ((n<0)||(n>t2.size())) throw e(s2);} catch (error& e){ cout << e.err<>stop; return 0; }