zoukankan      html  css  js  c++  java
  • C++笔记

    void f(vector<Entry>& ve,list<Entry>& le)
    {
        sort(ve.begin(),ve.end());
        unique_copy(ve.begin(),ve.end(),le.begin());
    }
    
    
    
    void f(vector<Entry>&ve,list<Entry>&le)
    {
        sort(ve.begin(),ve.end());
         unique_copy(ve.begin(),ve.end(),back_inserter(le));//append to le
    }
    
    void f(list<Entry>&ve,vector<Entry>&le)
    {
        copy(ve.begin(),ve.end(),le);//error: le not aniterator
        copy(ve.begin(),ve.end(),le.end());//bad: writes beyond the end
        copy(ve.begin(),ve.end(),le.begin());//overwrite elements
    }
    string::const  iterator  i = find(s.begin(),s.end(),c);
    
    void  f()
    {
    string  m = "Mary  had  a  little  lamb";
    int  a  count = count(m,´a´);
    }
    
    
    void  f(list<complex>& lc, vector<string>& vs, string  s)
    {
    int  i1 = count(lc.begin(),lc.end(),complex(1,3));
    int  i2 = count(vs.begin(),vs.end(),"Diogenes");
    int  i3 = count(s.begin(),s.end(),´x´);
    }
    
    void  g(char  cs[], int  sz)
    {
    int  i1 = count(&cs[0],&cs[sz],´z´);    // ’z’s in array
    int  i2 = count(&cs[0],&cs[sz/2],´z´);    // ’z’s in first half of array
    }
  • 相关阅读:
    iOS UI调试神器,插件injection for Xcode使用方法
    iOS 开发笔记-Objective-C之KVC、KVO
    iOS 测试企业应用的分发
    iOS 阅读唐巧博客心得
    iOS 添加启动图片
    Xcode 常用命令
    iOS 开发笔记
    iOS 开发常用链接总结
    iOS
    iOS UI基础
  • 原文地址:https://www.cnblogs.com/mengqingzhong/p/3049537.html
Copyright © 2011-2022 走看看