ImageVerifierCode 换一换
格式:DOCX , 页数:8 ,大小:16.43KB ,
资源ID:21198146      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/21198146.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(经典C程序100例7180Word文件下载.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

经典C程序100例7180Word文件下载.docx

1、,stui.name);for(j=0;j=4;scanf(num);ptr-data=num;next=(link)malloc(sizeof(node);if(i=4) ptr-next=NULL;else ptr=ptr-next;while(ptr!=NULL)The value is =%dn,ptr-data);ptr=ptr-【程序73】反向输出一个链表。/*reverse output a list*/struct list *next; link ptr,head,tail;int num,i;tail=(link)malloc(sizeof(node);tail-ptr=t

2、ail;nplease input 5 data=ptr-head=(link)malloc(sizeof(node);head-next=ptr;ptr=head;ptr=ptr-【程序74】连接两个链表。link delete_node(link pointer,link tmp)if (tmp=NULL) /*delete first node*/return pointer-else if(tmp-next-next=NULL)/*delete last node*/tmp-else /*delete the other node*/next=tmp-return pointer;vo

3、id selection_sort(link pointer,int num) link tmp,btmp;int i,min;num;tmp=pointer;min=tmp-data;btmp=NULL;while(tmp-next) if(mintmp-data)min=tmp-btmp=tmp;tmp=tmp-40: %dn,min);pointer=delete_node(pointer,btmp);link create_list(int array,int num) link tmp1,tmp2,pointer;int i;pointer=(link)malloc(sizeof(n

4、ode);pointer-data=array0;tmp1=pointer;for(i=1; tmp2=(link)malloc(sizeof(node);tmp2-data=arrayi;tmp1-next=tmp2;tmp1=tmp1-return pointer;link concatenate(link pointer1,link pointer2) link tmp;tmp=pointer1;while(tmp-next=pointer2;return pointer1;void main(void) int arr1=3,12,8,9,11;link ptr;ptr=create_

5、list(arr1,5);selection_sort(ptr,5);【程序75】放松一下,算一道简单的题目。int i,n;5; n=0;if(i!=1)n=n+1;if(i=3)if(i=4)=4)if(n=3)zhu hao shi de shi:%c,64+i);【程序76】编写一个函数,输入n为偶数时,调用函数求1/2+1/4+.+1/n,当输入n为奇数时,调用函数1/1+1/3+.+1/n(利用指针函数)float peven(),podd(),dcall();float sum;int n;while (1)n);if(n1)break;if(n%2=0)Even=sum=dca

6、ll(peven,n);Odd=sum=dcall(podd,n);%f,sum);float peven(int n)float s;s=1;for(i=2;=n;i+=2)s+=1/(float)i;return(s);float podd(n)s=0;float dcall(fp,n)float (*fp)();s=(*fp)(n);【程序77】填空练习(指向指针的指针) char *s=man,womangirlboysisterchar *q;int k;for(k=0;kk+);/*这里填写什么语句*/%sn,*q);【程序78】找到年龄最大的人,并输出。请找出程序中有什么问题。#

7、define N 4static struct man char name20;int age; personN=li,18,wang,19,zhang,20,sun,22;struct man *q,*p;int i,m=0;p=person;for (i=0;if(mage)q=p+;m=q-age;%s,%d,(*q).name,(*q).age);【程序79】字符串排序。char *str120,*str220,*str320;char swap();please input three stringsnscanf(,str1);,str2);,str3);if(strcmp(str1

8、,str2)0) swap(str1,str2);if(strcmp(str1,str3)0) swap(str1,str3);if(strcmp(str2,str3)0) swap(str2,str3);after being sortedn%sn%sn%sn,str1,str2,str3);char swap(p1,p2)char *p1,*p2;char *p20;strcpy(p,p1);strcpy(p1,p2);strcpy(p2,p);【程序80】海滩上有一堆桃子,五只猴子来分。第一只猴子把这堆桃子凭据分为五份,多了一个,这只猴子把多的一个扔入海中,拿走了一份。第二只猴子把剩下的桃子又平均分成五份,又多了一个,它同样把多的一个扔入海中,拿走了一份,第三、第四、第五只猴子都是这样做的,问海滩上原来最少有多少个桃子?int i,m,j,k,count;for(i=4;10000;i+=4) count=0;m=i;j=i/4*5+1;i=j;if(j%4=0)count+;elsei=m;if(count=4)printf(,count);

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1