Advertisement
Neveles

Untitled

Feb 16th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.29 KB | None | 0 0
  1. #include <iostream>
  2. #include "List.h"
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     /*cout << "<FIRST TEST>" << endl;
  9.     List mainList;
  10.     mainList += 1;
  11.     mainList += 2;
  12.     mainList += 3;
  13.     mainList += 4;
  14.     mainList += 5;
  15.     mainList += 6;
  16.     mainList += 7;
  17.     mainList += 8;
  18.     mainList += 9;
  19.     mainList += 0;
  20.     cout << "Main list before merge:" << endl << mainList << endl;
  21.  
  22.     List mergedList;
  23.     mergedList += 5;
  24.     mergedList += 7;
  25.     mergedList += 1;
  26.     mergedList += 0;
  27.     mergedList += 3;
  28.     mergedList += 63;
  29.     mergedList += 4;
  30.     mergedList += 3;
  31.     mergedList += 5;
  32.     mergedList += 43;
  33.     cout << "Merged list before merge:" << endl << mergedList << endl;
  34.  
  35.     if (mainList == mergedList)
  36.     {
  37.         cout << "Main and merge lists are equal" << endl;
  38.     }
  39.     else
  40.     {
  41.         cout << "Main and merge lists are not equal" << endl;
  42.     }
  43.  
  44.     List andList = (mainList & mergedList);
  45.     List orList = (mainList | mergedList);
  46.     mergedList.merge(mainList);
  47.  
  48.     cout << endl << "User list after merge:" << endl << mainList << endl;
  49.     cout << "Merged list after merge:" << endl << mergedList << endl;
  50.     cout << "And list:" << endl << andList << endl;
  51.     cout << "Or list:" << endl << orList << endl;*/
  52.  
  53.     cout << endl << endl << "<SECOND TEST>" << endl;
  54.     List mainListNo2;
  55.     mainListNo2 += 56;
  56.     mainListNo2 += 21;
  57.     mainListNo2 += 0;
  58.     mainListNo2 += 3;
  59.     mainListNo2 += 8;
  60.     mainListNo2 += -14;
  61.     mainListNo2 += 76;
  62.     mainListNo2 += -9;
  63.     mainListNo2 += 0;
  64.     mainListNo2 += 3;
  65.     cout << "Main list before merge:" << endl << mainListNo2 << endl;
  66.  
  67.     List mergedListNo2;
  68.     mergedListNo2 += -45;
  69.     mergedListNo2 += 7;
  70.     mergedListNo2 += 1;
  71.     mergedListNo2 += 0;
  72.     mergedListNo2 += 8;
  73.     mergedListNo2 += 5;
  74.     mergedListNo2 += 2;
  75.     mergedListNo2 += -35;
  76.     mergedListNo2 += 8;
  77.     mergedListNo2 += 3;
  78.     cout << "Merged list before merge:" << endl << mergedListNo2 << endl;
  79.  
  80.     //if (mainListNo2 == mergedListNo2)
  81.     //{
  82.     //  cout << "Main and merge lists are equal" << endl;
  83.     //}
  84.     //else
  85.     //{
  86.     //  cout << "Main and merge lists are not equal" << endl;
  87.     //}
  88.  
  89.     //List andListNo2 = (mainListNo2 & mergedListNo2);
  90.     //List orListNo2 = (mainListNo2 | mergedListNo2);
  91.     mergedListNo2.merge(mainListNo2);
  92.  
  93.     cout << endl << "User list after merge:" << endl << mainListNo2 << endl;
  94.     cout << "Merged list after merge:" << endl << mergedListNo2 << endl;
  95.     //cout << "And list:" << endl << andListNo2 << endl;
  96.     //cout << "Or list:" << endl << orListNo2 << endl;
  97.  
  98.     return 0;
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement