问题 单项选择题

若程序执行时的输入数据是"2473",则下述程序的输出结果是 #include<stdio.h> void main() { int cs; while((cs=getchar())!=,'\n') {switch(cs='2') { case0 case 1:putchar(cs+4); case 2:putchar(cs+4); break; case 3:putchar(cs+3);default:putchar(cs+2);}}}

A.668977

B.668966

C.6677877

D.6688766

答案

参考答案:A

解析: 本题主要考查switch语句的使用方法。switch语句的执行过程为:进入switch结构后,对条件表达式进行运算,然后从上至下去找与条件表达式值相匹配的 case,以此作为入口,执行switch结构中后面的各语句,直到遇到break语句,则跳出switch语句,如果各case都不匹配时,则执行default后面的语句。

单项选择题
单项选择题

It is clear that some chemicals can damage the health of animals and humans. (1) , this is not the only problem that (2) be caused by the careless use of chemicals. Chemicals can also (3) the ecological balance of the environment. If the ecological balance is disturbed, the results can be (4) serious.

The (5) of DDT illustrates the problem. DDT, a chemical which kills insects, at first seemed to be a perfect answer (6) many problems. It would control insects that caused dangerous diseases, (7) insects that caused billions of dollars of damage to crops every year. Governments permitted and even (8) the use of DDT. Farmers in many countries (9) to spray it on their crops. The (10) results were good: Damage to crops (11) down, and profits went up. However, the chemical had effects which the scientists didn’t see in (12) . First, it also killed insects which were the (13) enemies of the harmful insects and which were therefore beneficial to farmers. Second, and perhaps worse, DDT did not kill (14) harmful insect. A few insects had natural resistance to the chemical. They (15) and reproduced in large numbers. In a few years there were large numbers of insects which were not (16) by DDT, and there were (17) insects which could act as natural (18) on these new "super-insects". Finally, it became clear that DDT was not solving the insect problem. In fact, it was making the problem worse. It (19) became necessary to find a second (20) for the effects of the first.

17()

A.many 

B.a few 

C.a little 

D.fewer