全文预览

c语言测试及答案

上传者:科技星球 |  格式:pdf  |  页数:98 |  大小:8844KB

文档介绍
)\rÒL\rstruct work *insert( struct work * head Jong x,float y )\r{ struct work * this ,*new,* fro;\rnew=(struct work*) malloc( sizeof(struct work));\rnew->num=x; new->gz=y;\rif (head= = NULL)\rhead=new;\relse\r(\rthis=head;\rwhile((this! = NULL) &&(this->num>x))\r{fro=this;\rthis=this->next;\r)\rif(this= =head)\r{head=new;\rnew->next=this\r)\relse\r{fro->next=new;\rnew->next=this;.\rendif\rÓÔ\rstruc work * del(struct work *head, int x)\r{struct work *head, * this ,*fro;\rthis=head;\rwhile((this!=NULL) &&(this->num!=x)\r{fro=this;\rthid=this- next;\r)\rif (this! = NULL)\rIf(this= =head)\r{head=head->next;\rfree(this);\r)\relse\r(\rfro->next=this->next;\rfree(this);\r)\rendif\rendif

收藏

分享

举报
下载此文档