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

阜阳市城乡建设局网站百度seo怎么做网站内容优化

阜阳市城乡建设局网站,百度seo怎么做网站内容优化,吉林省建设银行网站,奉贤专业网站建设链表-节点最大值 本题要求实现一个函数#xff0c;遍历一个不带头节点的链表#xff0c;求链表节点数据的最大值 节点类型定义#xff1a; struct node { int ch ; struct node *next ;} 函数接口定义#xff1a; 在这里描述函数接口。例如#xff1a; int max_node( …链表-节点最大值 本题要求实现一个函数遍历一个不带头节点的链表求链表节点数据的最大值 节点类型定义 struct node { int ch ; struct node *next ;} 函数接口定义 在这里描述函数接口。例如 int max_node( struct node *p) p是链表头指针,返回链表上最大的ch属性值。 裁判测试程序样例 #include stdio.h #includestdlib.h struct node {int ch; struct node * next;}; struct node *setlink(int N);//建立链表函数已经定义int max_node(struct node * head);//需要定义这个函数int main() { int N; struct node *head; scanf(%d,N); headsetlink(N); printf(%d, max_node(head)); return 0; }输入样例 在这里给出一组输入。例如 6 7 8 9 1 2 3输出样例 在这里给出相应的输出。例如 9 其实这个题目相对简单我们只需要注意链表如何后移即可  int max_node( struct node *p) {int max0;maxp-ch;struct node * s;//定义一个临时变量sp;while(1){if(s-nextNULL)break;if(s-chmax)maxs-ch;ss-next; //可以实现进入下一个节点}return max; } 链表—累加和 本题要求实现一个函数遍历一个不带头结点的链表求链表节点数据的累加和 节点类型定义 struct node { int ch ; struct node *next ;} 函数接口定义 int sum_node( struct node *p) p是链表头指针,返回链表上所有节点ch属性值的累加和。 裁判测试程序样例 #include stdio.h #includestdlib.h struct node {int ch; struct node * next;};struct node *setlink(int N);//建链表函数已经定义 int sum_node(struct node * head);//需要定义的函数int main() { int N; struct node *head; scanf(%d,N); headsetlink(N); printf(%d, sum_node(head)); return 0; } /* 请在这里填写答案 */ 输入样例 在这里给出一组输入。例如 6 3 1 2 7 4 5输出样例 在这里给出相应的输出。例如 22 这个题目也较为简单只需要注意一下最后一步  #includestdio.h #includestdlib.h int sum_node( struct node *p) {int sum0;struct node * s;sp;while(1){if(s-nextNULL)break;sums-ch;ss-next;}sums-ch; //这里要注意尾结点的数据域在上面循环中未能进行处理return sum; } 链表——统计节点个数 定义函数遍历一个不带头结点的链表统计链表上的节点个数 函数接口定义 int countnode(struct node * head) head是链表头指针返回值是节点个数 裁判测试程序样例 #include stdio.h #includestdlib.h struct node {int ch; struct node * next;}; struct node *setlink(int N);//建立链表函数已建立int countnode(struct node * head);//需要顶一次函数int main() { int i,N; struct node *head; scanf(%d,N); headsetlink(N); printf(%d, countnode(head)); return 0; }/* 请在这里填写答案 */ 输入样例 在这里给出一组输入。例如 6 1 2 3 4 5 6输出样例 在这里给出相应的输出。例如 6 看完前两个题目这个题也很容易了  #includestdio.h #includestdlib.h int countnode(struct node * head) {int a0;struct node * s;shead;while(1){if(s-nextNULL)break;else{a;ss-next;}}return a1; //跟第二个题一样需要注意尾结点 } 逆序数据建立链表 本题要求实现一个函数按输入数据的逆序建立一个链表。 函数接口定义 struct ListNode *createlist(); 函数createlist利用scanf从输入中获取一系列正整数当读到−1时表示输入结束。按输入数据的逆序建立一个链表并返回链表头指针。链表节点结构定义如下 struct ListNode { int data; struct ListNode *next; }; 裁判测试程序样例 #include stdio.h #include stdlib.hstruct ListNode {int data;struct ListNode *next; };struct ListNode *createlist();int main() {struct ListNode *p, *head NULL;head createlist();for ( p head; p ! NULL; p p-next )printf(%d , p-data);printf(\n);return 0; }/* 你的代码将被嵌在这里 */ 输入样例 1 2 3 4 5 6 7 -1输出样例 7 6 5 4 3 2 1 看了前三个是不是感觉还可以呢现在来上点难度  分析一下题目逆序输出链表那不就是要用头插法建立链表么头插法就是一直往前插入数据而尾插法是一直往后插入数据。 #includestdio.h #includestdlib.h #includemalloc.h struct ListNode *createlist() {struct ListNode * s,* head;int data;head(struct ListNode *)malloc(sizeof(struct ListNode));//这里我们要建立一个头结点head-nextNULL; //头结点的指针域为空while(1){scanf(%d,data);if(data-1)//链表结束标志break;s(struct ListNode *)malloc(sizeof(struct ListNode));s-datadata; //s中存储新的数据s-nexthead-next; //s的指针域指向头结点head-nexts; //头结点的指针域指向存放新数据的s} //循环结束后head相当于头指针其指针域指向我们所要的第一个节点return head-next; } 判断回文字符串 本题要求编写函数判断给定的一串字符是否为“回文”。所谓“回文”是指顺读和倒读都一样的字符串。如“XYZYX”和“xyzzyx”都是回文。 函数接口定义 int Judge_char( char *s ); 函数Judge_char判断输入字符串char *s是否为回文若是则返回1否则返回0。 裁判测试程序样例 #include stdio.h #include string.h #define MAXN 20 int Judge_char( char *s );int main() {char s[MAXN];scanf(%s, s);if ( Judge_char(s)1 )printf(Yes\n);elseprintf(No\n);printf(%s\n, s);return 0; }/* 你的代码将被嵌在这里 */ 输入样例 thisistrueurtsisiht输出样例 Yes thisistrueurtsisiht输入样例 thisisnottrue输出样例 No thisisnottrue 最后再附上最近碰见的回文吧  #includestdio.h #includestring.h int Judge_char( char *s ) {int i0,j;for(i0,jstrlen(s)-1-i;ij;i,j--){if(s[i]!s[j])break;}if(ji) //是回文的话一定存在ij,否则不是回文return 1;if(ij)return 0; } 欢迎大家积极留言呀
http://www.zqtcl.cn/news/806080/

相关文章:

  • 网站备案有什么要求wordpress导航栏上方
  • 河南专业建网站wordpress seo模板
  • 网站开发的教学课程策划公司经营范围有哪些
  • 需要锦州网站建设男生和女生做污的事情免费网站
  • 互联网网站商标免费做h5的网站有哪些
  • 营销型网站五大系统 单仁深圳住房与建设局官网
  • nas 做网站wordpress音乐门户主题
  • 企业邮箱163登录入口seo建站需求
  • 外贸企业网站源码下载域名和服务器多少钱
  • 镇江专业建网站建设外汇网站
  • 网站关键词优化软件效果wordpress如何网站顶部右侧广告
  • seo整站优化报价wordpress网站资源
  • 假冒彩票网站开发仿小刀娱乐wordpress主题
  • 东光做淘宝网站古色古香的网站模板
  • 创建网站得花多少钱福州最好的网站建设
  • mysql asp网站开发企业失信被执行人查询
  • 网站制作完工验收单软件开发模型有哪几种
  • saas建站平台源码wordpress 安装主题 无法创建目录
  • 兰州做高端网站做网站学什么专业
  • dedecms 图片网站模板wordpress省市联动
  • pw域名网站杭州建站官网建设
  • 河北省建设厅网站官网网站js时间代码
  • 网站开发实现编码深圳做网站专业
  • 网站建设电子合同h5网站开发多少钱
  • 邓州做网站投票网站做seo如何
  • 环保网站建设项目备案系统免费虚拟主机空间
  • 网站实现语言转换技术上该怎么做免费下载网页模板
  • 云南网站建设专业品牌网站建设电子商务
  • 保健食品东莞网站建设莱芜金点子信息港交友
  • 小程序视频网站开发网站开发项目预算表