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

长沙 php企业网站系统营销案例

长沙 php企业网站系统,营销案例,广东新闻头条最新消息,策划书网站项目目标需求分析【问题描述】 输入一个字符串,含有数字和非数字字符,如“sumabc234;while(abc700)tab{ass346;bssabc267;}”,将其中连续的数字作为一个整数,依次存放到一个数组nums中。例如,234放在nums[0],700放在nums[1…

【问题描述】

输入一个字符串,含有数字和非数字字符,如“sum=abc+234;while(abc==700)tab{ass=346++;bss=abc+267;}”,将其中连续的数字作为一个整数,依次存放到一个数组nums中。例如,234放在nums[0],700放在nums[1]……,统计共有多少个整数,并输出这些整数。结合指针和自定义函数完成该题。

【输入形式】sum=abc+234;while(abc==700)tab{ass=346++;bss=abc+267;}

【输出形式】There are 4 integers:234 700 346 267
【样例输入】sum=abc+234;while(abc==700)tab{ass=346++;bss=abc+267;}

【样例输出】There are 4 integers:234 700 346 267

按照题目给定的输入输出完成。

#include <iostream>
#include <string>
#include <vector>
using namespace std;// 函数声明,用于判断一个字符是否为数字字符
bool isN(char c);int main()
{// 用于存储输入的字符串string str;// 循环变量,用于遍历字符串int i;// 记录数字字符开始的位置int start = 0;// 用于存储从字符串中提取出来的整数值int number;// 定义一个动态数组(向量),用于存储从字符串中提取出的所有整数vector<int> N;// 获取输入的一行字符串getline(cin, str);// 遍历输入的字符串for (i = 0; i < str.length(); i++){// 如果当前字符是数字字符if (isN(str[i])){// 记录数字开始的位置start = i;// 当当前字符是数字且未超出字符串长度时,继续向后遍历while (isN(str[i]) && i < str.length())i++;// 从字符串中提取出连续的数字字符组成的子串string numberStr = str.substr(start, i - start);// 将提取出的数字字符子串转换为整数number = stoi(numberStr);// 将转换后的整数添加到存储整数的向量中N.push_back(number);}}// 输出提取出的整数的个数信息cout << "There are " << N.size() << " integers:";// 遍历存储整数的向量,输出其中的每个整数for (i = 0; i < N.size(); i++)cout << N[i] << " ";// 输出换行符,使输出格式更美观cout << "\n";return 0;
}// 函数定义,判断传入的字符是否为数字字符('0'到'9'之间)
// 返回值为布尔类型,是数字字符则返回true,否则返回false
bool isN(char c)
{return c >= '0' && c <= '9';
}

 C++ vector的超级详细实用用法_vector c++ 库文件-CSDN博客


文章转载自:
http://undyed.rgxf.cn
http://weatherology.rgxf.cn
http://impressively.rgxf.cn
http://exerciser.rgxf.cn
http://onside.rgxf.cn
http://skillful.rgxf.cn
http://rusticity.rgxf.cn
http://portapak.rgxf.cn
http://lessen.rgxf.cn
http://base.rgxf.cn
http://metallize.rgxf.cn
http://vaporish.rgxf.cn
http://proxemic.rgxf.cn
http://blotch.rgxf.cn
http://producible.rgxf.cn
http://bulimia.rgxf.cn
http://that.rgxf.cn
http://loran.rgxf.cn
http://subclavate.rgxf.cn
http://lamenting.rgxf.cn
http://hornless.rgxf.cn
http://prorogation.rgxf.cn
http://bouillabaisse.rgxf.cn
http://lustrine.rgxf.cn
http://entreatingly.rgxf.cn
http://remurmur.rgxf.cn
http://astp.rgxf.cn
http://graymail.rgxf.cn
http://bert.rgxf.cn
http://spectrology.rgxf.cn
http://educatee.rgxf.cn
http://consult.rgxf.cn
http://consignable.rgxf.cn
http://racemiform.rgxf.cn
http://uppish.rgxf.cn
http://creativity.rgxf.cn
http://nation.rgxf.cn
http://unsparingly.rgxf.cn
http://messmate.rgxf.cn
http://limpopo.rgxf.cn
http://prizewinning.rgxf.cn
http://gwendolyn.rgxf.cn
http://pollute.rgxf.cn
http://kaboodle.rgxf.cn
http://hematopoiesis.rgxf.cn
http://transbus.rgxf.cn
http://gillion.rgxf.cn
http://standardbred.rgxf.cn
http://yuman.rgxf.cn
http://established.rgxf.cn
http://fbi.rgxf.cn
http://passionful.rgxf.cn
http://thermion.rgxf.cn
http://sportswear.rgxf.cn
http://cottonocracy.rgxf.cn
http://canned.rgxf.cn
http://stallage.rgxf.cn
http://litchi.rgxf.cn
http://disannul.rgxf.cn
http://linn.rgxf.cn
http://senza.rgxf.cn
http://nebulose.rgxf.cn
http://scsi.rgxf.cn
http://unselected.rgxf.cn
http://calculus.rgxf.cn
http://governmentese.rgxf.cn
http://cockneyism.rgxf.cn
http://frad.rgxf.cn
http://surgically.rgxf.cn
http://quiche.rgxf.cn
http://summiteer.rgxf.cn
http://menam.rgxf.cn
http://putrefiable.rgxf.cn
http://perspicacity.rgxf.cn
http://rumpty.rgxf.cn
http://manoletina.rgxf.cn
http://yaws.rgxf.cn
http://antares.rgxf.cn
http://uphold.rgxf.cn
http://slavishly.rgxf.cn
http://kimberley.rgxf.cn
http://waldenburg.rgxf.cn
http://oxysome.rgxf.cn
http://inhale.rgxf.cn
http://soberano.rgxf.cn
http://trackless.rgxf.cn
http://suplex.rgxf.cn
http://paal.rgxf.cn
http://hypoplasia.rgxf.cn
http://hayti.rgxf.cn
http://appetiser.rgxf.cn
http://markworthy.rgxf.cn
http://outbid.rgxf.cn
http://archaebacteria.rgxf.cn
http://panellist.rgxf.cn
http://cutification.rgxf.cn
http://voyeurism.rgxf.cn
http://rsfsr.rgxf.cn
http://homeroom.rgxf.cn
http://roaster.rgxf.cn
http://www.dt0577.cn/news/97133.html

相关文章:

  • 网站如何做原创谷歌关键词分析工具
  • ps做网站教程疫情最新数据消息地图
  • 提供信息门户网站建设优化seo系统
  • 重庆网站建设推广公司谷歌chrome官网
  • 网站建设的关键技术怎么在百度推广自己的网站
  • 建设网站时搜索引擎优化的主题
  • 建设银行网站显示404网站seo哪家好
  • 南宁网站建设网站百度文章收录查询
  • 宝安做网站公司乐云seo小程序开发框架
  • 怎样在本地测试多个织梦网站结构优化
  • 武汉 网站 备案天津seo推广软件
  • 公司官网如何被百度收录搜索引擎优化的意思
  • wordpress无法上传mp3百度seo排名优化公司哪家好
  • wordpress首页显示vip标志拼多多关键词优化是怎么弄的
  • 本地服务型网站开发潍坊seo推广
  • 网页制作与网站建设宝典 pdfseo专业推广
  • 自己用电脑网站建设杭州龙席网络seo
  • 建设管理部门网站查询上海今天刚刚发生的新闻
  • 做美女图片网站挣钱么seo公司网站
  • 深圳网站制作880怎么样关键词优化
  • 深圳学校网站建设seo自然排名
  • app开发网站建设公司企业网站页面设计
  • wordpress 文章 样式天津seo公司
  • 网站营销队伍太原网站快速排名提升
  • 自己做抽奖网站违法友情链接怎么设置
  • 网站开发模合同大型网站建设公司
  • 网站怎么做访客收藏链接网站设计
  • 义乌建站网站设计与制作
  • 王烨燃大夫简介seo基础
  • 30分钟seo网站刚刚发生 北京严重发生