[C++]容器和算法

http://yun.baidu.com/share/link?shareid=618584960&uk=3190641435&third=0
关于顺序容器,关联容器,泛型算法。
关于适配器理解: 参考: http://blog.csdn.net/thefutureisour/article/details/7751846

#include <iostream>
#include <stack>

using namespace std;

int main() {
    stack<int> stk;
    stack<int>::size_type size_max = 10;
    int input = 0;
    while (stk.size() != size_max) {
        stk.push(input++);
    }
    int det = 0;
    while (stk.empty() == false) {
        det++;
        stk.pop();
    }
    cout << det << endl;
    return 0;
}

Created by stary_yan on 2/12/16.
Copyright © 2016 stary_yan. All rights reserved.

你可能感兴趣的:([C++]容器和算法)