资源描述:
《闽高校考试模拟系统编程题汇总》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1.答案见1.c#include#include#defineROW4#defineCOL4#defineLEN12intfun(inta[][COL],intb[]){/**/Inti,j,t,k=0,sum=0;For(i=0;i2、ROW][COL]={{-2,0,-3,-1},{-8,2,0,-4},{0,3,-3,-12},{21,0,-13,3}};intarrb[LEN],i,result;for(i=0;i3、);}2.答案见2.c#include#includevoidfun(intarr[],doublex,inty){/**/doublez;z=(y+2)*pow(x,y)arr[0]=(int)z;arr[1]=(int)(z*100)%100;/**/}voidmain(){inty;doublex;intarra[2];printf("Pleaseenterx(11.0&&x<2.0)&&(y>0&&y<=
4、6)){fun(arra,x,y);printf("part1=%d,part2=%d",arra[0],arra[1]);}elseprintf("xoryisoutofrange!");getch();}3.答案见3.c#include#defineROW9intfun(inta[]){/**/inti,j,t;for(i=0;i5、tarra[ROW]={45,58,33,24,40,20,30,28,31};intmax_pre,i;max_pre=fun(arra);printf("arrayarrais:");for(i=0;i#includevoidmain(){doublex;intn;doublefun(doublex,intn);printf("Pl
6、easeenterx,n:");scanf("%lf%d",&x,&n);printf("fun=%lf",fun(x,n));getch();}doublefun(doublex,intn){/**/doubley;if(n==1)y=x;elseif(n>1)y=(x+1)*fun(x,n-1);returny;/**/}5.答案见5.c#include#defineN5#defineM8voidfun(inta[],intb[],intc[]){/**/Inti,j,k;For(i=0;i7、]=a[i];For(j=0;j8、f("%d",arra[k]);printf("arrayarrbis:");for(k=0;k
|