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

网站js幻灯片代码网站关键词排名如何做

网站js幻灯片代码,网站关键词排名如何做,网站后台cms,买男装最好的购物网站1.第一个题#xff0c;大概题目意思是求n句话中最长的单词和最短的单词 这个题目做的有点磕巴#xff0c;好几年没有写过c/c了#xff0c;连string的复制都不会写了#xff0c;哈哈哈#xff0c;太笨了 后面一点点捡起来#xff0c;还是写出来了#xff0c;本身没啥大概题目意思是求n句话中最长的单词和最短的单词 这个题目做的有点磕巴好几年没有写过c/c了连string的复制都不会写了哈哈哈太笨了 后面一点点捡起来还是写出来了本身没啥 第一整行读入要自己分单词 第二 就是复制的时候是浅层copy还是深层copy这里也忘记那个是深那个是浅了反正就是一个直接复制地址一个是复制内容。 粗暴的代码 #includevector #includecmath #includecstring #include iostream #includealgorithm using namespace std; vectorstring str; vectorint str_leng; int main(){int num;cin num;string line;int min_num10000;int max_num0;char max_str[1000],min_str[1000];getline(cin,line);while(num){getline(cin,line);if (1){ // cout num line endl;int len0;char tmp[1000];for (int i0;iline.length();i){if (line[i]! ){tmp[len]line[i];len;}if(line[i] | iline.length()-1){tmp [len]\0; // couttmp len: lenendl;if (lenmax_num){ // couttmpendl;max_numlen;strcpy(max_str,tmp);}if(lenmin_num){ // coutmin: tmpendl;min_num len;strcpy(min_str,tmp);}len0;strcpy(tmp,);}}}num--;}coutmax_strendl;coutmin_strendl;return 0; }2、就是对n个学生进行按成绩从高到低进行排序成绩重复的按名字字典序从小到大排序 这里就是自己设置一个学生结构体然后自定义个结构体排序就好了 还可以的代码 沉默: #includeiostream #includecstdio #includecmath #includealgorithm using namespace std;struct student{char name[20];int score; }; bool com(const student x,const student y) {if(x.scorey.score)return x.namey.name;return x.scorey.score; } int main(){int n;cin n;student std[30];for(int i0;in;i){cin std[i].name std[i].score;}sort(std,stdn,com);for(int i0;in;i){coutstd[i].name std[i].scoreendl;}return 0; }3题 代码 数学计算题 #includeiostream #includecstdio #includecmath using namespace std;int main(){int n1;int res0;int tmp 0;for (int i0;i1;i){tmp (n1)*2;n tmp;}cout nendl;return 0; }用队列来表示能生存的数字被队列抛弃的就是死掉的数字最后只剩一个数的时候就是最终答案。 #includeiostream #includecstdio #includecmath #includealgorithm #includequeue using namespace std; queueint q1; int main(){int n;cinn;int id1;int num1;q1.push(id);bool flagfalse;while(!q1.empty()){if(flag q1.size()1){coutq1.front()endl;return 0;}num;if (idn !flag){id;}else{flagtrue;idq1.front();q1.pop();}if(num3){num0;}else{q1.push(id);}}return 0; }
http://www.tj-hxxt.cn/news/230192.html

相关文章:

  • 质控中心网站建设申请建立免费网站的步骤
  • 温州网站开发技术简单网页设计html代码
  • 静态网站和伪静态seo二手网站建设模块
  • 网站商城建站网站用什么域名
  • 计算机网站建设名称牡丹江在哪个城市
  • 揭阳做网站的简述你身边的网络营销事件
  • 网站开发简历的项目经验怎么建立自己公司的网站
  • 恢复被百度k网站 关键词收录html5门户网站模版
  • 卢沟桥做网站的公司福州网站设计知名乐云seo
  • 中小网站建设都有哪些宿迁市网站建设
  • 微信 网站 优劣势珠海市网站建设开发公司
  • 用旧手机做网站做的网站有广告图片
  • 首次做淘宝客网站要安装程序吗电子工程网络通信的专业课
  • 企业网站建设参考文献wordpress5.2自动保存
  • 在线教育网站源码无限次数视频app软件ios
  • 湖南奉天建设集团网站上海百度
  • 丹东做网站公司室内设计软件自己设计
  • 网站自做书本seo公司上海
  • 转运公司网站建设有关外贸的网站有哪些
  • 网站管理助手未找到iis海口wordpress培训
  • wordpress网站网速慢搜索网站
  • 微信公众号里的小网站怎么做的设计素材网站月收益
  • 做盗版小说网站 风险2017建站
  • 如何给网站做脚本郑州网络营销推广公司
  • 网站全局参数设置网站建设贰金手指下拉
  • 网站的发展前景什么网站做任务
  • 建网站平台wordpress5.0不能发布文章
  • 亚马逊网站建设特点jsp网站开发实例精讲
  • 从化企业网站建设网站app开发计划书
  • hao爱做网站深圳龙华邮编