本科C语言程序设计教程教学资料包课后习题答案 第十章习题答案.doc

本科C语言程序设计教程教学资料包课后习题答案 第十章习题答案.doc

ID:52298100

大小:27.00 KB

页数:3页

时间:2020-03-26

本科C语言程序设计教程教学资料包课后习题答案 第十章习题答案.doc_第1页
本科C语言程序设计教程教学资料包课后习题答案 第十章习题答案.doc_第2页
本科C语言程序设计教程教学资料包课后习题答案 第十章习题答案.doc_第3页
资源描述:

《本科C语言程序设计教程教学资料包课后习题答案 第十章习题答案.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、第十章一、选择CADBDDCDCDCDDDC二、编程Structwork{longnum;floatgz;};创建structwork*Create(structwork*head){structwork*this,*new;new=(structwork*)malloc(sizeof(structstru));if(head==NULL)head=new;else{this=head;while(this->next!=NULL)this=this->next;this->next=new;new->next=nullsc

2、anf(“%ld”,&new->num);scanf(“%f”.,&gz);}endifreturn(head);}浏览voidlist(structwork*head){structwork*this,*new;if(head==null)printf(“nodata!”);else{this=head;do{printf(“%ld,%f”,this->num,this->gz);this=this->next;}while(this!=NULL);endif}}插入structwork*insert(structwo

3、rk*head,longx,floaty){structwork*this,*new,*fro;new=(structwork*)malloc(sizeof(structwork));new->num=x;new->gz=y;if(head==NULL)head=new;else{this=head;while((this!=NULL)&&(this->num>x)){fro=this;this=this->next;}if(this==head){head=new;new->next=this}else{fro->next

4、=new;new->next=this;}endif}删除strucwork*del(structwork*head,intx){structwork*head,*this,*fro;this=head;while((this!=NULL)&&(this->num!=x){fro=this;thid=this-next;}if(this!=NULL)If(this==head){head=head->next;free(this);}else{fro->next=this->next;free(this);}endifend

5、if

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。