Advertisement
ChaeYuriya

Week 6 : main.cpp

Nov 3rd, 2024
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. #include <iostream>
  2. #include "DLL.cpp"
  3.  
  4. int main(){
  5.     List data;
  6.     infotype H;
  7.     address elm;
  8.     createNewList(data);
  9.     printList(data);
  10.  
  11.     for(int x = 0; x<3;x++){
  12.         cin>>H.title;
  13.         cin>>H.url;
  14.         cin>>H.timestamp;
  15.         cin>>H.visitcount;
  16.  
  17.         elm = createElemen(H);
  18.         insertLast(data,elm);
  19.         cout << "+>. Hasil" << endl;
  20.         printList(data);
  21.     }
  22.  
  23.     cout << "+>. First" << endl;
  24.     deleteFirst(data,elm);
  25.     printList(data);
  26.     cout << "+>. Last" << endl;
  27.     deleteLast(data,elm);
  28.     printList(data);
  29.     cout << "+>. Last" << endl;
  30.     deleteLast(data,elm);
  31.     printList(data);
  32.  
  33.     cout << "Part 2" << endl;
  34.  
  35.     createNewList(data);
  36.     printList(data);
  37.  
  38.     for(int x = 0; x<3;x++){
  39.         cin>>H.title;
  40.         cin>>H.url;
  41.         cin>>H.timestamp;
  42.         cin>>H.visitcount;
  43.  
  44.         insertAscending(data,H);
  45.         cout << "+>. Hasil" << endl;
  46.         printList(data);
  47.     }
  48.  
  49.     cout << findElemen(data,"OpenAI")<<endl;
  50.     cout << moreThanOnce(data)<<endl;
  51.  
  52.  
  53. }
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement