Advertisement
DoominoR

14 Laba+ основной файл

Dec 17th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include "Header.h"
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     cout << "Enter first element of list: \n";
  10.     int head;
  11.     cin >> head;
  12.     list* temp = init(head);
  13.     list* root = temp;
  14.     for (;;)
  15.     {
  16.         cout << "Enter next element of list, or '0' for stop:\n";
  17.         int next;
  18.         cin >> next;
  19.         if (next == 0) break;
  20.         temp = addelem(temp, next);
  21.     }
  22.     listprint(root);
  23.     if (root->field < 0)
  24.     {
  25.         root = deletehead(root);
  26.     }
  27.     deleteNegative(root);
  28.     cout << endl;
  29.     listprint(root);
  30.     system("pause");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement