Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
STL stack
//Title of this code //clang 3.6.0 #include <iostream> #include <stack> using namespace std; int main(void) { stack <int> st1,st2; int j; cout<<"Pushing data into stack..."<<endl; st1.push(21); j=st1.top(); cout<<j; st1.push(9); j=st1.top(); cout<<j; st1.push(12); j=st1.top(); cout<<j; st1.push(31); j=st1.top(); cout<<j<<endl; stack<int>::size_type i; i=st1.size(); cout<<"The stacklength is"<<i<<endl; i=st1.top(); cout<<"The element at the top of the stack is"<<i<<endl; st1.pop(); i=st1.size(); cout<<"After a pop,the stack length is"<<i<<endl; i=st1.top(); cout<<"After a pop,the element at the top of the stack is"<<i<<endl; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
hello,world !ssn2019
boost::geometry::distance performance overhead compared to a straightforward implementation
Throttle Example (Send two requests every two seconds)
problem_name_4
Example Node Program
Example of custom deleter to manage a resource.
Program to Time Difference
Clang-IsBaseOf
regex
Zadanie Dejwu
Please log in to post a comment.