Advertisement
operaatoors

Grafa apiešana, ejot dziļumā (C++)

Mar 7th, 2016
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <stack>
  2. #include <iostream>
  3. #include <stdlib.h>
  4. using namespace std;
  5.  
  6. int main() {
  7.     stack<int> s;
  8.     s.push(1);  s.push(2); s.push(3);
  9.  
  10.     cout << "Steka elementi: ";
  11.    
  12.     while(!s.empty()){
  13.         int top = s.top();
  14.         cout << top << " ";
  15.         s.pop();
  16.     }
  17.    
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement