欢迎来到天天文库
浏览记录
ID:6722872
大小:396.50 KB
页数:41页
时间:2018-01-23
《c语言程序设计作业整理ⅱ_浙大软院c语言》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、7.1.1输入一个正整数n(02、h>intmain(void){inti,j,n,x;intrepeat,ri;inta[10];scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;ia[i])continue;j=n-1;while(j>=i){a[j+1]=a[j];j--;}a[i]=x;break;}if(i==n)a3、[n]=x;for(i=0;iintmain(void){inti,n,sum;intrepeat,ri;inta[10];doubleaver;scanf("%d",&repea4、t);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;i5、示例:括号内为说明输入2(repeat=2)4(n=4)108125(n=5)12540输出2181004521#includeintmain(void){inti,n,temp;intrepeat,ri;inta[10];scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;i6、]=a[n-1-i];a[n-1-i]=temp;}for(i=0;iintmain(void){inti,index,n;intri,repeat;inta[10];scanf("%d",&r7、epeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;ia[index])index=i;printf("max=%d,index=%d",a[index],index);}retu8、rn0;}7.1.5输入一个正整数n(1
2、h>intmain(void){inti,j,n,x;intrepeat,ri;inta[10];scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;ia[i])continue;j=n-1;while(j>=i){a[j+1]=a[j];j--;}a[i]=x;break;}if(i==n)a
3、[n]=x;for(i=0;iintmain(void){inti,n,sum;intrepeat,ri;inta[10];doubleaver;scanf("%d",&repea
4、t);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;i5、示例:括号内为说明输入2(repeat=2)4(n=4)108125(n=5)12540输出2181004521#includeintmain(void){inti,n,temp;intrepeat,ri;inta[10];scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;i6、]=a[n-1-i];a[n-1-i]=temp;}for(i=0;iintmain(void){inti,index,n;intri,repeat;inta[10];scanf("%d",&r7、epeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;ia[index])index=i;printf("max=%d,index=%d",a[index],index);}retu8、rn0;}7.1.5输入一个正整数n(1
5、示例:括号内为说明输入2(repeat=2)4(n=4)108125(n=5)12540输出2181004521#includeintmain(void){inti,n,temp;intrepeat,ri;inta[10];scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;i6、]=a[n-1-i];a[n-1-i]=temp;}for(i=0;iintmain(void){inti,index,n;intri,repeat;inta[10];scanf("%d",&r7、epeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;ia[index])index=i;printf("max=%d,index=%d",a[index],index);}retu8、rn0;}7.1.5输入一个正整数n(1
6、]=a[n-1-i];a[n-1-i]=temp;}for(i=0;iintmain(void){inti,index,n;intri,repeat;inta[10];scanf("%d",&r
7、epeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&n);for(i=0;ia[index])index=i;printf("max=%d,index=%d",a[index],index);}retu
8、rn0;}7.1.5输入一个正整数n(1
此文档下载收益归作者所有