问题 单项选择题

阅读下面的程序段: publiC class Sun {public static void main (String args[ ]){ int a=0; for(int i=1;i<=3;i++) {for(int j=1;j<=i;j++){ for(int k=j;k<=3;k++) {a=a+1; }} } System.out.println(A) ; } } 执行上面的3重循环后,a的值为( )。

A.3

B.9

C.14

D.21

答案

参考答案:C

解析: 本题考查对for循环嵌套的理解。本题应用3重嵌套循环,循环嵌套的执行,当外层循环执行1次,内层循环就要执行所有循环。i=1时,j=1,k执行3次循环得到a的值3;i=2,j=1时,k执行3次循环得到a的值加3并覆盖原值,j=2时,k执行两次循环,a的值加2;依次,i=3时,j执行3次。其中,分别执行3、2、1次,a的值分别加3、2、1,最后得到a的值14。故本题答案是C。

多项选择题
单项选择题

A variety of illegal acts committed by people in the course of their employment, for their own personal gain, are collectively known as white-collar crime. Embezzlement, theft and trading securities (1) insider information are common forms of white-collar crime. The majority of cases involve low-level employees who steal because they are under (2) financial stress. Many plan to (3) the money back as soon as possible but may never do so. Their crimes are usually never (4) because the amounts of money are small, and no one notices the (5) .

(6) , there are some very large cases of white-collar crime, such as multimillion-dollar stock market or banking seams that take years to discover and are extremely difficult and expensive to (7) .

White-collar crime is not (8) to the business sector. Government employment, especially (9) the city level, also provides opportunities to (10) one’s pockets. (11) , building inspectors accept bribes and full-time employees receive (12) payments.

Although white-collar crime is less (13) than street crime, it involves (14) more money and harm to the public than crimes committed by street criminals. It is (15) that there are more criminals (16) the office suites than in the streets, yet the (17) of white-collar makes it difficult to uncover the offenses and pursue the offenders. As the economy (18) from manufacturing to services and electronic commerce, opportunities for white-collar crime (19) , while the technology needed to stop such crimes will (20) .

19()

A.degenerate

B.upgrade

C.decrease

D.multiply