当前位置: 首页 > wzjs >正文

昆明外贸网站设计服务商网站备案时要不要关闭

昆明外贸网站设计服务商,网站备案时要不要关闭,工商注册公司需要哪些材料,seo网站推广怎么做本篇来介绍C++中find和find_if函数的使用,通过多个实例来演示。 find用于基础的查找功能,find_if可以实现更复杂的匹配查找条件。 1 find 1.1 函数原型 template <class InputIterator, class T> InputIterator find ( InputIterator first, InputIterator last, c…

本篇来介绍C++中find和find_if函数的使用,通过多个实例来演示。

find用于基础的查找功能,find_if可以实现更复杂的匹配查找条件。

1 find

1.1 函数原型

template <class InputIterator, class T>
InputIterator find ( InputIterator first, InputIterator last, constT& value );

1.2 在vector中查找

find通常用于在vector中查找是否存在指定的元素。

//g++ test1.cpp -std=c++11 -o test1
#include <unistd.h>
#include <stdio.h>
#include <vector>
#include <algorithm>int main()
{printf("hello\n");std::vector<int> numberList = {1, 3, 5, 7, 8, 9};int num = 7;// 循环查找for (int &it : numberList){if (it == num){printf("find num:%d in numberList\n", it);break;}}// find方式查找auto it = std::find(numberList.begin(),numberList.end(),num);if (it != numberList.end()){printf("find num:%d in numberList\n", *it);}return 0;
}

运行结果:

1.3 查找字符串

find也可用于在字符串查找字符和子串。

//g++ test2.cpp -std=c++11 -o test2
#include <unistd.h>
#include <stdio.h>
#include <string>
#include <algorithm>int main()
{printf("hello\n");std::string s1 = "hello world, hello c++";auto r1 = s1.find('l');auto r2 = s1.find('a');auto r3 = s1.find("ll");auto r4 = s1.find("abc");if (r1 != std::string::npos) {printf("r1: 字符 'l' 首次出现的位置是 %zu\n", r1);} else {printf("r1: 未找到字符 'l'\n");}if (r2 != std::string::npos

文章转载自:

http://bKyeZPLK.gcbhh.cn
http://H2GoqqJD.gcbhh.cn
http://CSfiC6zr.gcbhh.cn
http://pqzDO7rv.gcbhh.cn
http://JdYNOW6K.gcbhh.cn
http://32lYYMEE.gcbhh.cn
http://17fxblLS.gcbhh.cn
http://8hxDSqO6.gcbhh.cn
http://o21I88mR.gcbhh.cn
http://FATxVqIK.gcbhh.cn
http://zGKvFgi9.gcbhh.cn
http://28ZyWBi8.gcbhh.cn
http://zl5GEphi.gcbhh.cn
http://yNOARprx.gcbhh.cn
http://NUJaioGN.gcbhh.cn
http://hKlXQRuK.gcbhh.cn
http://4dn9AsqK.gcbhh.cn
http://hb06hBI5.gcbhh.cn
http://ZEIpFojz.gcbhh.cn
http://ctULReu3.gcbhh.cn
http://ZRANg9t3.gcbhh.cn
http://HR8V2ZA4.gcbhh.cn
http://VW0aTpsd.gcbhh.cn
http://eJ34RtBA.gcbhh.cn
http://XOuZCw6c.gcbhh.cn
http://G23Fpt7m.gcbhh.cn
http://vA2x2sZr.gcbhh.cn
http://NMLwcjno.gcbhh.cn
http://qrpG2ExX.gcbhh.cn
http://6n9kQBLL.gcbhh.cn
http://www.dtcms.com/wzjs/683431.html

相关文章:

  • 中国电信网站备案 锁定百度网络电话
  • 网页上做ppt的网站好知名外贸网站建设公司
  • 可以做问卷调查的网站北京互联网公司大厂有哪些
  • 网上做效果图网站宁乡的网站建设
  • 做数据ppt模板下载网站品牌建设ppt文档下载
  • 网站空间数据向网站服务器上传网页文件下载
  • 有域名怎么建网站南宁中文域名网站
  • 青岛移动网站建设免费搭建个人博客网站
  • 怎么建设网站首页视频会议系统直播聊天网站开发
  • 做响应式网站多少钱做论坛app网站有哪些
  • 企业网站制作公司盈利郴州网站建设公司哪个好
  • 有什么做第二职业的网站吗品牌设计 品牌标志设计
  • 网站导航栏下面的文章html网站模板 淘宝商城
  • wordpress 站内信软件开发公司服务
  • 浙江建设培训中心网站手机个人网站制作教程
  • 小学网站建设成都wordpress 二级页面
  • 济南网站建设认可搜点网络WordPress修改数据库地址
  • 网站备案格式买一个网站需要多少钱
  • 艺术学校示范校建设专题网站百度爱采购网站官网
  • 网站建设只是凯叔讲故事网站谁做的
  • 通过模版做网站商河网站建设公司
  • 专做短篇的网站wordpress模板淘客
  • 视频直播网站开发 设计石家庄网站建设选汉狮
  • 网站排名下降了怎么办浙江网站建设优化
  • 网站流量 钱软件开发公司网站设计
  • 电商网站建设与管理 教案东莞市微信网站建设品牌
  • 赶集网网站建设费用wordpress 长腿蜘蛛
  • 用 net做网站湖南优度网络科技有限公司
  • 企业网站关键词查看注册过的网站
  • 手机网站建站用哪个软件好opensuse wordpress