Advertisement
Guest User

3

a guest
Dec 17th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include "Header.h"
  3. using namespace std;
  4.  
  5. int main() {
  6.     setlocale(0, "");
  7.     int i = 1, k;
  8.     int a;
  9.     //Node *top = first(NULL);
  10.     Node *top = NULL;
  11.     cout << "Введите количество элементов стека: ";
  12.     cin >> k;
  13.    
  14.     cout << "Введите любые " << k << " чисел: ";
  15.     while (i <= k) {
  16.        
  17.         cin >> a;
  18.         push(&top, a);
  19.         i++;
  20.     }
  21.    
  22.  
  23.     /*if (pop(&top) != 0) {
  24.        
  25.     }*/
  26.  
  27.    
  28.    
  29.     for (int i = 0; i < k; i++) {
  30.         cout << pop(&top) << "\n";
  31.     }
  32.    
  33.     system("pause");
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement