Advertisement
Neveles

Main

Feb 12th, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include "List.h"
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     List randomList;
  9.     List userList;
  10.     List mergedList;
  11.  
  12.     for (int i = 0; i < 5; ++i)
  13.     {
  14.         randomList += rand() % 10;
  15.     }
  16.  
  17.     cout << "<User list input>" << endl;
  18.     int value = 0;
  19.     for (int i = 0; i < 5; ++i)
  20.     {
  21.         cin >> value;
  22.         userList += value;
  23.     }
  24.  
  25.     cout << endl << "<Merge list input>" << endl;
  26.     for (int i = 0; i < 5; ++i)
  27.     {
  28.         cin >> value;
  29.         mergedList += value;
  30.     }
  31.  
  32.     mergedList.merge(userList);
  33.  
  34.     cout << endl << "Random list:" << endl << randomList << endl;
  35.     cout << "User list:" << endl << userList << endl;
  36.     cout << "Merged list:" << endl << mergedList << endl;
  37.  
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement