- 1、本文档共203页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
上 机 题 库
第一部分 填空题
?????????????????????????????????????????????????????????????
注意:源程序存放在考生文件夹下的BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
请在程序下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
?????????????????????????????????????????????????????????????
给定程序中,函数FUN的功能是:计算出带有头接点的单向链表中各结点数据域之和作为函数值返回。
#include stdio.h
#include stdlib.h
#define N 8
typedef struct list
{ int data;
struct list *next;
} SLIST;
SLIST *creatlist(int *);
void outlist(SLIST *);
int fun( SLIST *h)
{ SLIST *p; int s=0;
p=h-next;
while(p)
{
/**********************************found*********************************/
s+= p-___1___; data
/**********************************found*********************************/
p=p-___2___; next
}
return s;
}
main( )
{ SLIST *head;
int a[N]={12,87,45,32,91,16,20,48};
head=creatlist(a); outlist(head);
/**********************************found*********************************/
printf(\nsum=%d\n, fun(___3___)); head
}
SLIST *creatlist(int a[ ])
{ SLIST *h,*p,*q; int i;
h=p=(SLIST *)malloc(sizeof(SLIST));
for(i=0; iN; i++)
{ q=(SLIST *)malloc(sizeof(SLIST));
q-data=a[i]; p-next=q; p=q;
}
p-next=0;
return h;
}
void outlist(SLIST *h)
{ SLIST *p;
p=h-next;
if (p==NULL) printf(The list is NULL!\n);
else
{ printf(\nHead );
do
{ printf(-%d, p-data); p=p-next; }
while(p!=NULL);
printf(-End\n);
}
}
给定程序中,函数FUN的功能是:求出形参SS所指字符串数组中最长字符串的长度,其余字符串左边用字符*补齐,使其与最长的字符串等长。字符串数组中工有M个字符串,且串长N。
#include stdio.h
#include string.h
#define M 5
#define N 20
void fun(char (*ss)[N])
{ int i, j, k=0, n, m, len;
for(i=0; iM; i++)
{ len=strlen(ss[i]);
if(i==0) n=len;
if(lenn) {
/**********************************found*********************************/
n=len; k=___1___; i
}
}
for(i=0; iM; i++)
您可能关注的文档
- 光谱分析检验方法..doc
- 入党志愿书打印模板..docx
- 入党志愿书(参考模板)..doc
- 入党志愿书模板(发给支部)..doc
- 全国中小企业股份转让系统交易支持平台数据接口规范v1020130701..doc
- 全国公路工程地质科技情报网成员单位..doc
- 全国37个城市社会保险基数及缴费比例表..doc
- 全国各省市城市轨道交通项目概览【更新中】..doc
- 先简支后连续预应力溷凝土连续箱梁30m_计算书..doc
- 全国工业产品生产许可证委托加工备案申请书..doc
- 2024至2030年中国羚羊角类饮片行业深度调查与前景预测分析报告.docx
- 重庆市面向中国农业大学定向选调2024届大学毕业生2024年国家公务员考试考试大纲历年真题14笔试历.docx
- 重庆市面向西北工业大学定向选调2024届大学毕业生00笔试历年典型考题及解题思路附答案详解.docx
- 中国不动杆菌感染治疗药行业市场现状分析及竞争格局与投资发展研究报告2024-2029版.docx
- 2024至2030年全球与中国ETL软件市场现状及未来发展趋势.docx
- 初中八年级(初二)生物下册期末考试1含答案解析.docx
- 干簧式继电器项目申请报告.docx
- 2024至2030年中国左氧氟沙星片行业深度调查与前景预测分析报告.docx
- 菜籽项目申请报告.docx
- 2024至2030年中国八角钢行业深度调查与前景预测分析报告.docx
文档评论(0)