单选题 Java
题号 #2592029

下面程序段的输出结果是(  )。

进入在线模考

参考答案

C

答案解析

本题是对for循环语句和数组的综合考查。题中共定义了两个数组:a[]和p[],共用了3次for循环;第1个for语句对数组a[i]赋值;第2个for语句对数组p[i]赋值;第3个for语句计算k的值。3次循环分别得到:5,15和33。正确答案为选项C。

你可能感兴趣的试题

A.ActionListener
B.FocusListener
C.MouseMotionListener
D.WindowListener
A.int read(byte[])
B.void flush(  )
C.void close(  )
D.int available(  )
找试题 · 找答案 · 找资料 在线模考