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

网站建设项目表网络创意广告策划方案

网站建设项目表,网络创意广告策划方案,建设一个下载资料的网站,工信部做网站认证吗目录 1.find 2.atoi 3.to_string 4.getline 【leetcode 习题】 387.字符串中的第一个唯一字符 125. 验证回文串 1.find 1.查找第一次出现的目标字符串#xff1a;说明#xff1a;如果查找成功则输出查找到的第一个位置#xff0c;否则返回-1#xff1b; s1.find(s2…目录 1.find 2.atoi 3.to_string 4.getline 【leetcode 习题】 387.字符串中的第一个唯一字符 125. 验证回文串 1.find 1.查找第一次出现的目标字符串说明如果查找成功则输出查找到的第一个位置否则返回-1 s1.find(s2) #include iostream #include string using namespace std; int main() {string s1 abcdef;string s2 de;int ans s1.find(s2) ; //在S1中查找子串S2cout ans endl;system (pause); } 2.查找从指定位置开始的第一次出现的目标字符串 s1.find(s2, 2)  #include iostream #include string using namespace std; int main() {string s1 abcdef;string s2 de;int ans s1.find(s2, 2) ; //从S1的第二个字符开始查找子串S2cout ans endl;system(pause); } 2.atoi atoi()函数的语法非常简单 int atoi (const char * str); int integer type which is the type of returned value. int整数类型它是返回值的类型。 const char * is a constant char array that is equal to a string whose variable name is str. const char *是一个常量char数组它等于一个变量名称为str 。 作用在C和C 中将字符串/字符转换为整数 (Convert String/Char To Integer In C and C) 可以参考如下实例 #include iostream #include cstdlibint main() {const char *str1 57;const char *str2 314.159;const char *str3 52345 some text;const char *str4 some text 25;int mynum1 std::atoi(str1);int mynum2 std::atoi(str2);int mynum3 std::atoi(str3);int mynum4 std::atoi(str4);std::cout atoi(\ str1 \) is mynum1 \n;std::cout atoi(\ str2 \) is mynum2 \n;std::cout atoi(\ str3 \) is mynum3 \n;std::cout atoi(\ str4 \) is mynum4 \n; } If given string or char array is floating-point like “314.159”  in only integer part will be converted where the result will be “314” 如果给定的字符串或char数组是浮点数例如“ 314.159”则仅整数部分将被转换结果为“ 314”If there are some non-numerical chars in the given char array or string they will not convert and there will be no error where only the integer part will be converted. As an example “52345 some text” will be converted 52345 如果给定的char数组或字符串中有一些非数字char它们将不会转换并且只有整数部分会被转换也不会出错。 例如“ 52345 some text”将被转换为52345If the start of the char array or string and there are numerical characters after them this will be converted into 0 as an integer value. As an example “some text 25” will be converted into 0. 如果char数组或字符串的开头并且后面有数字字符则将其转换为0作为整数值。 例如“一些文本25”将转换为0。If the numerical characters are between non-numeric characters the conversion result will be 0 too. 如果数字字符介于非数字字符之间则转换结果也将为0。If the char array or string starts with numeric character and after that, there is a non-numeric, and then numeric character only the starting numeric character will be converted. As an example “25 text 50” will be converted into 25. 如果char数组或字符串以数字字符开头并且之后是非数字字符则仅将起始数字字符转换为数字字符。 例如“ 25个文本50”将转换为25。 【总结来说】字符转化为数字是以起始为主要参考的 3.to_string 将数字常量转换为字符串返回值为转换完毕的字符串 头文件#include string 必须加 string s to_string(i); //将整数i转换为字符串表示形式 附如果是string s to_string(‘3’)则结果是s 51。 需要对s s -48; 才能得到正确的结果。 #include iostream #include string using namespace std;int main() {string pi pi is std::to_string(3.1415926);string perfect to_string(1 2 4 7 14) is a perfect number;cout pi \n;cout perfect \n;system(pause);return 0; }4.getline 作用打印一行字符串可打印空格 应用 题解  【leetcode 习题】 387.字符串中的第一个唯一字符 !!!  get以坐标为方式的查找次数加法  count [ s [ i ] ]1 125. 验证回文串 如果有兴趣了解原理可以读一下下面这篇文章来更深入的了解string STL 的string类怎么啦
http://www.w-s-a.com/news/460421/

相关文章:

  • 客户管理系统哪找公司网站如何做优化
  • 常德企业网站建设广州站在哪里
  • 移动端网站建站视频教程网站如何做淘客
  • 注册网站会不会有风险网站建设实训致谢语
  • ssh框架做的家政服务网站需要做网站建设的公司
  • 众筹网站制作长春高端网站建设
  • 亳州网站网站建设wordpress汉化.po
  • 怎样给建设的网站提意见网红营销概念
  • 怎么知道一个网站是谁做的广告行业网
  • 上海app定制开发公司大城网站优化
  • 工厂 网站建设北京招聘网站设计师
  • 企业网站建设与网络营销的关系网页qq音乐在线听
  • 网站如何制作学校的做做代销的网站
  • 灌云网站建设维护常州市天宁区建设局网站
  • 广州中小企业网站建设网络营销平台的类型
  • 做非遗网站的原因wordpress ip 插件
  • 微信企业网站 源码下载wordpress 4.9.5 太卡
  • 湖北网站建设公司哪家好房地产最新政策调整
  • 重庆建设岗位培训网站今天重大新闻乌克兰
  • 流水线 东莞网站建设如何在网上销售产品
  • 哪些做图片赚钱的网站网站建设销售业绩任务
  • 建立网站 知乎如何做网站的图片滑动块
  • 国外做珠宝的网站有哪些滨湖区建设局官方网站
  • 关于中国幼教网站开发的经验中国建设银行晋中分行网站
  • 挪威网站后缀如何外贸网络推广
  • 外汇交易网站开发仟亿家设计软件好吗亿家
  • 专门教做甜品的网站郑州高新区建设环保局网站
  • 建站公司怎么获客网站建设全网营销
  • 黄石做网站的公司html免费网站模板
  • 做个商城网站怎么做便宜优酷视频网站源码