问题 单项选择题

下列程序的运行结果为
#include<stdio.h>
vold abc(char*str)
int a,b;
for(a=b=0;str[a]! =’\0’;a++)
if(str[a]!=’c’)
str[b++]=str[a];
str[b]=’\0’;
void main()
char str[]="abcdef";
abc(str);
printf("str[]=%s",str);

A.str[]=abdef

B.str[]=abcdef

C.str[]=a

D.str[]=ab

答案

参考答案:A

解析: 本题考查了用字符指针引用字符数组中的字符及对字符的操作。函数abc()的for语句执行过程是:丛字符指针str所指向的字符数组的第一个元素开始,逐一判断字符是否为’c’,若不是就执行一次数组元素的赋值过程,若字符为’c’就不执行,所以答案为A)。

阅读理解

阅读理解。

     "What would you do if you were the mayor (市长) of your city?" We asked some students from

different cities in Anhui. Here's what they said:

      Deng Chuan, 15, from Hefei

      With the development of modern industry, more and more waste water is being poured into the

Fei River, It has caused serious pollution. The river is becoming so dirty that few living things can live

in it. So, if I were the mayor, I would order all the factories that pour the waste water into the river to

close down. As we all know, water is very important to our lives. So it is very important to protect water.

      Zhang Yan, 14, from Wuhu

      Our city is more and more beautiful. But sometimes it's not convenient for the blind. There are not

enough pavements (人行道) in our city. Some of the old ones are broken. They may not be safe to walk

on! If I were the mayor of our city, I would build more pavements for the blind.

      Wang Lili, 16, from Chaohu

      There are more and more old people in our city. And there are not enough places for them to relax

and enjoy themselves. So, if I were the mayor, I would build an activity center in each residential (住宅)

area for the old. So old people can play cards or chess. This will make old people not feel lonely and spend

remaining years comfortably.

1. What does Deng Chuan care for? [ ]

A. Water pollution.

B. Air pollution.

C. Pavements for the blind.

D. Activity centers for the old.

2. Who's the youngest of the three students?[ ]

A. Deng Chuan.

B. Zhang Yan.

C. Wang Lili.

D. We don't know.

3. What can old people do in activity center? [ ]

A. Play football.

B. See movies.

C. Play chess.

D. Go shopping.

4. Which of the following is NOT TRUE? [ ]

A. It's very important for Heifei to protect water.

B. There aren't enough places for the old to relax and enjoy themselves in Chaohu.

C. There are enough pavements for the blind in Wuhu.

D. Some of the old pavements in Wuhu are broken.

5. We can probably see this passage in            . [ ]

A. a notice

B. a novel

C. an advertisement

D. a newspaper

选择题