خرید بک لینک

The Main Functions:​​​​​​

// CPP program to demonstrate working of STL stack
#include
#include
using namespace std;

Stacks in C++ Language.

void showstack(stack s) {
while (!s.empty()) { // That means the stack isn't empty.
cout << 't' << s.top();
s.pop();
}
cout << 'n';
}

int main () {
stack s;
s.push(10);
s.push(30);
s.push(20);
s.push(5);
s.push(1);

cout << "The stack is : ";
showstack(s);

cout << "ns.size() : " << s.size();
cout << "ns.top() : " << s.top();


cout << "ns.pop() : ";
s.pop();
showstack(s);

return 0;
}

برچسب: نویسنده: یلدا صفری تاريخ: شنبه 24 مرداد 1405 ساعت: 15:10

صفحه بندی