zoukankan      html  css  js  c++  java
  • C++ list 查找

    #include <iostream>
    #include <list>
    #include <algorithm>

    using namespace std;


    int main()
    {
      list<int> list1;
      for (int k=0;k<10;k++)
      {
        list1.push_back(k);
      }

      for (int k=0;k<10;k++)
      {
        list1.insert(list1.end(), k);
      }

      list<int>::iterator list_iter1;
      for (list_iter1 = list1.begin();list_iter1 != list1.end();++list_iter1)
      {
        cout << *list_iter1 << " ";
      }
      cout << endl;

      //find
      list<int>::iterator list_iter2 = find(list1.begin(),list1.end(),2);
      cout << *list_iter2 << endl;

      system("pause");
      return 0;
    }

  • 相关阅读:
    14.会场安排问题(L4)
    图形化调试工具DDD
    sking
    全排列
    DNS
    一种排序
    多边形重心问题
    街区最短路径问题
    Fibonacci数
    python url解析
  • 原文地址:https://www.cnblogs.com/herd/p/11003740.html
Copyright © 2011-2022 走看看