Advertisement
ItsMeLucifer

AISD Struktury Zad1

Oct 11th, 2019
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct elem{
  6.     int dane;
  7.     elem * nast;
  8. }stos;
  9. void push(elem * &stos,int x){
  10.     elem *el = new elem;
  11.     el->dane = x;
  12.     el->nast=stos;
  13.     stos = el;
  14. }
  15. int pop(elem* &stos){
  16.     if(stos){
  17.         elem * temp = stos;
  18.         stos=stos->nast;
  19.         temp->dane;
  20.         delete temp;
  21.     }
  22. }
  23. int main()
  24. {
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement