首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序,输出结果( )。 #include<iostream.h> void main() {static int b[][3]={{1,2,3},{4},{5,6}}; b[0][2]=12,b[1][2]=18
有以下程序,输出结果( )。 #include<iostream.h> void main() {static int b[][3]={{1,2,3},{4},{5,6}}; b[0][2]=12,b[1][2]=18
admin
2020-11-11
20
问题
有以下程序,输出结果( )。
#include<iostream.h>
void main()
{static int b[][3]={{1,2,3},{4},{5,6}};
b[0][2]=12,b[1][2]=18;
cout<<**b<<’’\t’’<<**(b+1)
<<’’\t’’<<**(b+1)<<’’\t’’<<*(*(b+1)+2)<<’’\n’’;
cout<<b[0][2]+b[1][2]+b[2][2]<<end1;
}
选项
A、1 4 4 18 30
B、1 1 4 4 18
C、4 4 18 1 1
D、4 4 4 30 1
答案
A
解析
本题b是一个3×3的二维数组:利用指针表示数组:*(*(数组名+i)+j)。**b表示b[0][0]元素,值是1,**(b+1)表示是b[0][1]的元素,值是4。*(*(b+1)+2)表示b[1][2]的元素,值是18,b[0][2]+b[1][2]+b[2][2]之和是30。
转载请注明原文地址:https://kaotiyun.com/show/Kcyp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列符号中可以用作C++标识符的是()。
有如下程序#inelude<iostream>usingnamespacestd;intmain(){chara;cin>>a;if(a=’*’)cout<<’’***’’<<end1
运算符重载时不需要保持的性质是()。
下面属于白盒测试方法的是()。
下面属于黑盒测试方法的是()。
设树T的深度为4,其中度为1,2,3,4的结点个数分别为4,2,1,1。则T中的叶子结点数为()。
请使用VC6或使用【答题】菜单打开考生文件夹prog2下的工程prog2。此工程中包含一个程序文件main.epp,其中有“部门”类Department和“职工”类Staff的定义,还有主函数main的定义。在主函数中定义了两个“职工”对象,他们属于同一部
有如下函数定义:voidfunc(inta,int&b){a++;b++;}若执行代码段:intx=0,y=1;func(x,y);则变量x和y的值分别是()。
若对数组进行初始化,下列选项中,错误的是()。
下列选项中不属于面向对象程序设计特征的是
随机试题
已知函数f(x)=.试问方程f(x)=x在区间(0,+∞)内有几个实根?
肝棘球蚴病的影像表现错误的是
男性,55岁。急性心肌梗死4周,今晨再发胸痛,持续8小时不缓解,遂来急诊。查体:BP100/60mmHg,心率95次/分,心肺检查无异常,心电图:I、aVL导联ST段弓背向上抬高。血清肌钙蛋白升高。该患者胸痛最可能的原因是
女,55岁。双腕,双手近段指尖关节、掌指关节肿痛3年,晨僵1小时。查体:双腕、双手2~4掌指关节及3~4近端指间关节肿胀,压痛,ANA(-)。患者病变的基本特征是
设f(x)=x2+ax2+bx在x=1处有极小值-2,则必()。
根据1998年11月14日辛央金融工作会议的决定,在()设立中国人民银行总行营业管理部。
Ifyouoftenfeeltiredandthedoctorcan’tfindanythingwrongwithyou,youmaybeinastateofsub-health(亚健康).Subhealthi
下列哪个具体行政行为不在行政复议的范围内?()
规范,是指人们在特定环境下被要求如何行动、如何思维、如何体验的期望,是一种相对固定的行为表现。根据以上的定义,下面哪种行为体现了规范?( )
某二叉树的中序遍历序列为CBADE,后序遍历序列为CBADE,则前序遍历序列为
最新回复
(
0
)