问题 单项选择题

有以下程序:
#include<stdio.h>
#include<string.h>
#include
void f(char*s,char*t)
char k;
k=*s; *s=*t; *t=k;
s++;t--;
if(*s)f(s,t):

main()
char str[10]="abcdefg",*P;
P=str+strlen(str)/2+1:
f(p,p-2);
printf("%s\n",str);

程序运行后的输出结果是______。

A) abcdefg
B) gfedcba
C) gbcdefa
D) abedcfg

答案

参考答案:B

解析: 本程序的作用是将字符串str倒序。语句“p=str+strlen(str)/2+1;”用于将指针变量p指向e字符所在的储存单元,p-2指向了c字符所在的存储单元,在函数f中将这两个存储单元的内容交换,并使得f函数中指向e字符的指针变量s加1。指向c字符的指针变量t减1,然后继续将s和t指向的存储单元的内容进行交换,直到s指向的存储单元的内容为空为止。

多项选择题
阅读理解

阅读理解

     The human brain contains 10 thousand million cells and each of these may have a thousand connections. Such enormous numbers used to discourage us and ease us to dismiss the possibility of making a machine with human-like ability, but now that we have grown used to moving forward at such a pace we can be

less sure. Quite soon, in only l0 or 20 years, perhaps, we will be able to assemble a machine as complex

as the human brain, and if we can we will. It may then take us a long time to render it intelligent by loading

in the right software or by altering the architecture but that too will happen.

     I think it certain that in decades, not centuries, machines of silicon(硅) will arise first to rival and then

exceed(超越) their human ancestors. Once they exceed us they will be capable of their own design in a

real sense they will be able to reproduce themselves. Silicon will have ended carbon's long control. And

we will no longer be able to claim ourselves to be the finest intelligence in the known universe.

     As the intelligence of robots increases to match that of humans and as their cost declines through

economies of scale we may use them to expand our frontiers, first on earth through their ability to withstand environments, harmful to ourselves. Thus, deserts may bloom and the ocean be mined. Further ahead, by a combination of the great wealth this new age will bring and the technology it will provide, the construction

of a vast, man-created world in space, home to thousands or millions of people, will be within our power.

1. In what way can we make a machine intelligent?

A. By making it work in such environments as deserts, oceans or space.

B. By working hard for 10 or 20 years.

C. By either properly programming it or changing its structure.

D. By reproducing it.

2. What does the writer think about machines with human-like ability?

A. He believes they will be useful to human beings.

B. He believes that they will control us in the future.

C. He is not quite sure in what way they may influence us.

D. He doesn't consider the construction of such machines possible.

3. The underlined word"carbon"in Para. 2 stands for         .

A. intelligent robots          

B. a chemical element       

C. an organic substance        

D. human beings

4. A robot can be used to expand our frontiers when         .

A. its intelligence and cost are beyond question

B. it is able to bear the rough environment

C. it is made as complex as the human brain

D. its architecture is different from that of the present ones

5. It can be inferred from the passage that          .

A. after the installation of a great number of cells and connections, robots will be capable of

    self-reproduction.

B. with the rapid development of technology, people have come to realize the possibility of making a

     machine with human-like ability

C. once we make a machine as complex as the human brain. it will possess intelligence

D. robots will have control of the vast, man-made world in space