stl.cpp

来自「数值计算工具库,C语言编写的,可以直接调用.」· C++ 代码 · 共 28 行

CPP
28
字号
#include <list>
#include <deque>

#ifndef BZ_NO_NAMESPACES
using namespace std;
#endif

int main()
{
    list<int> x;
    x.push_back(5);
    x.push_back(10);

    int sum = 0;

    for (list<int>::iterator iter = x.begin();
        iter != x.end(); ++iter)
    {
        sum += *iter;
    }

    if (sum != 15)
        return 1;

    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?