首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include main() { int x[3][2]={0}, i; for(i=0; i
有以下程序 #include main() { int x[3][2]={0}, i; for(i=0; i
admin
2015-07-28
39
问题
有以下程序
#include
main()
{ int x[3][2]={0}, i;
for(i=0; i<3; i++) scanf("%d",x
);
printf("%3d%3d%3d\n",x[0][0],x[0][1],x[1][0]);
}
若运行时输入:2 4 6<回车>,则输出结果为( )。
选项
A、2 0 4
B、2 0 0
C、2 4 0
D、2 4 6
答案
A
解析
二维数组x[3][2]可以分解成三个一维数组,x
为一个一维数组,含有的元素有x
[0]、x
[1]。x
同样为一个地址常量,记录的是第i行的第一个元素的首地址,所以输入数据为2、4、6时相当于x[0][0]=2,x[1][0]=4,x[2][0]=6,其余元素为0,所以答案选A。
转载请注明原文地址:https://kaotiyun.com/show/HzDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列4条叙述中,正确的一条是______。
设有以下函数:voidfun(intn,char*$s){……}则下面对函数指针的定义和赋值均正确的是
有以下程序#includemain(){int13=2,k=0;while(k++&&n++>2);Pintf(”%d%d\n”,k,n.);}程序运行后的输出结果是
以下选项中,能用作用户标识符的是
对于循环队列,下列叙述中正确的是
以下程序的功能是:借助指针变量找出数组元素中的最大值及其元素的下标值。请填空。#inculdemain(){inta[10],*p,*s;For(p=a;p-a
以下程序用以删除字符串中所有的空格,请填空。#inculdemain(){chars[100]=(“ourteacherteachclanguage!”);intI,j;For(i=j=0;s[i]!=’’)
以下选项中与iF(a==1)a=B;elsea++;语句功能不同的sWish语句是
下列选项中,合法的C语言关键字是()。
随机试题
《声声慢》是一首慢词,婉约词,是作者前期词的代表作品。()
下列情况中,交割仓库应承担赔偿责任的有()。
1689年《权利法案》颁布的主要意义在于()。
如果你打算拍一部以18世纪的英国为背景的影片,下列不可能在影片中出现的情景是()。
AftertheWarofIndependence,Americansdesignedanewsystem.Whatit?
Therearevariouswaysinwhichindividualeconomicunitscaninteractwithoneanother.Threebasicwaysmaybedescribedasth
A、Stomachcancer.B、Skincancer.C、Lungcancer.D、Bloodcancer.AA是老师提到阳光可以防御癌症后列举的例子之一。B是曝晒导致的。
A、Seeifhequalifiesforastudentloan.B、Makeaproposaltothegovernment.C、Starttosaveuptopayforhiskidstogotos
FootballandMoneyWhywasitfootball,ratherthantheothergreatVictoriansports,thatcapturedtheworld?Onereasonma
A、Whethertoaccepthisboss’sjoboffer.B、Whethertoapplytotransfertoanotherplace.C、Whethertofindanewjob.D、Whethe
最新回复
(
0
)