Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout << "<FIRST TEST>" << endl;
- List mainList;
- mainList += 1;
- mainList += 2;
- mainList += 3;
- mainList += 4;
- mainList += 5;
- mainList += 6;
- mainList += 7;
- mainList += 8;
- mainList += 9;
- mainList += 0;
- cout << "Main list before merge:" << endl << mainList << endl;
- List mergedList;
- mergedList += 5;
- mergedList += 7;
- mergedList += 1;
- mergedList += 0;
- mergedList += 3;
- mergedList += 63;
- mergedList += 4;
- mergedList += 3;
- mergedList += 5;
- mergedList += 43;
- cout << "Merged list before merge:" << endl << mergedList << endl;
- if (mainList == mergedList)
- {
- cout << "Main and merge lists are equal" << endl;
- }
- else
- {
- cout << "Main and merge lists are not equal" << endl;
- }
- List andList = (mainList & mergedList);
- List orList = (mainList | mergedList);
- mergedList.merge(mainList);
- cout << endl << "User list after merge:" << endl << mainList << endl;
- cout << "Merged list after merge:" << endl << mergedList << endl;
- cout << "And list:" << endl << andList << endl;
- cout << "Or list:" << endl << orList << endl;
- cout << endl << endl << "<SECOND TEST>" << endl;
- List mainListNo2;
- mainListNo2 += 56;
- mainListNo2 += 21;
- mainListNo2 += 0;
- mainListNo2 += 3;
- mainListNo2 += 8;
- mainListNo2 += -14;
- mainListNo2 += 76;
- mainListNo2 += -9;
- mainListNo2 += 0;
- mainListNo2 += 3;
- cout << "Main list before merge:" << endl << mainListNo2 << endl;
- List mergedListNo2;
- mergedListNo2 += -45;
- mergedListNo2 += 7;
- mergedListNo2 += 1;
- mergedListNo2 += 0;
- mergedListNo2 += 8;
- mergedListNo2 += 5;
- mergedListNo2 += 2;
- mergedListNo2 += -35;
- mergedListNo2 += 8;
- mergedListNo2 += 3;
- cout << "Merged list before merge:" << endl << mergedListNo2 << endl;
- if (mainListNo2 == mergedListNo2)
- {
- cout << "Main and merge lists are equal" << endl;
- }
- else
- {
- cout << "Main and merge lists are not equal" << endl;
- }
- List andListNo2 = (mainListNo2 & mergedListNo2);
- List orListNo2 = (mainListNo2 | mergedListNo2);
- mergedListNo2.merge(mainListNo2);
- cout << endl << "User list after merge:" << endl << mainListNo2 << endl;
- cout << "Merged list after merge:" << endl << mergedListNo2 << endl;
- cout << "And list:" << endl << andListNo2 << endl;
- cout << "Or list:" << endl << orListNo2 << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement