二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer test)

二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer test)

ID:16502831

大小:49.50 KB

页数:33页

时间:2018-08-10

二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer  test)_第1页
二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer  test)_第2页
二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer  test)_第3页
二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer  test)_第4页
二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer  test)_第5页
资源描述:

《二级c语言之二维数组与指针测试(two level c language two-dimensional array and pointer test)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、二级c语言之二维数组与指针2测试(TwolevelClanguagetwo-dimensionalarrayandpointer2test)Http://www.educity.cnAuthor:unknownsource:commentintothecommunitynetworkinJuly27,2006TheNationalComputerRankExaminationtwoCcollectioncontainingtheanswerquestionsovertheyears(CHMfile

2、)"Theninthpart:thetwo-dimensionalarrayandpointerAchoice(1)thefollowingprocedures(main){Inta[3][3],*p,i;P=&a[0][0];For(i=0;i<9;i++)P[i]=i;For(i=0;i<3;i++)Printf(%d,a[1][i]);}OutputistheresultofrunningtheprogramA)012B)123C)234D)345(2)thefollowingprocedu

3、res(main){int(*ptr)a[3][2]={0},[2],I,j;For(i=0;i<2;i++){ptr=a+i;Scanf(%d,PTR);Ptr++;}For(i=0;i<3;i++){For(j=0;j<2;j++)Printf(%2d,a[i][j]);Printf("");}}IftheRuntime:123,outputresultsA)errorinformationB)102000C)123000D)102030(3)thefollowingproc

4、edures(main){Intnum[4][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}},I,j;For(i=0;i<4;i++){For(j=1;j<=i;j++printf("%c"),'');For(j=j<4;j++)printf(%4d,num[i][j]);Printf("");}}Ifthefollowingoutputintheformofrighttrianglearray12346781112SixteenThep

5、rogramshouldfilltheunderlineA)I-1B)IC)i+1D)4-i(4)thefollowingdefinitionofatwo-dimensionalarrayiscorrectAinta[][3]);Binta[][3]={2*3});Cinta[][3]={});Dinta[2][3]={{1},{2},{3,4}});(5)ifthefollowinginstructionsandstatements,intc[4][5](*p)[5];p=c;Carrayele

6、mentreferenceiscorrectA)p+1B)*(p+3)C)*(p+1)+3D)*(p[0]+2))(6)thefollowingdefinitionsandstatementsInta[3][2]={1,2,3,4,5,6,*p[3]};P[0]=a[1];*p[0]+1)isrepresentedbyarrayelementsA)a[0][1]B)a[1][0]C)a[1][1]D)a[1][2](7)thefollowingproceduresIntf(intb[][4]){i

7、nti,J,s=0;For(j=0;j<4;j++){i=j;If(i>2)i=3-j;S+=b[i][j];}Returns;}(main){inta[4][4]={{1,2,3,4},{0,2,4,5},{3,6,9,12},{3,2,1,0}};Printf("%d",f(A));}OutputistheresultoftheexecutionofA)12B)11C)18D)16(8)thefollowingcannotdefinethecorrectoptionistwo-dimens

8、ionalarrayInta[2][2]={{1},{2}}A);Binta[][2]={1,2,3,4});Inta[2][2]={{1},2,3}C);Inta[2][]={{1,2},{3,4}}D);(9)ifdefined:int*p[3];then,thestatementsbelowiscorrectA)definesabasetypepointervariablepint,thisvariablehasthreepointersB)definesapointerto

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

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

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