STL库之栈的简单应用

来源:互联网 发布:帝国cms api接口 编辑:程序博客网 时间:2024/04/28 18:47
#include <iostream>#include <stack>int main(){    std::stack <std::string> s;    s.push("Hello");    s.push("World");    s.push("!");    std::cout << s.top() << std::endl ;    s.pop();    std::cout << s.top() << std::endl;    s.pop();    std::cout << s.top() << std::endl;    return 0;}

0 0
原创粉丝点击