问题 填空题

有一个已排好序的数组,今输入一个数,要求按原来的顺序规律将它插入到数组中。算法是:假设排序顺序是从小到大,对输入的数,检查它在数组中哪个数之后,然后将比这个数大的数顺序后移一个位置,在空出的位置上将该数插入。请在程序中的空白处填上一条语句或一个表达式。 #define N 100 main() { float a[N+1],x; int i,p; for(i=0;i<N;i++)scanf("%f"&a[i]); scanf("%f",&x); for(i=0,p=N;i<N;i++)if(x<a[i]){ 【18】 ;break;} for(i=N-1; 【19】 ;i-)a[i+1]=a[i]; a[p]=x; for(i=0; 【20】 ;i++) { printf("%8.2f",a[i]); if(i%5=0) printf("\n"); } }

答案

参考答案:[18] p=i;

解析:[19] i>=p [20] i<=N[评析] 本题主要考查了插入排序。由于程序中的数组在开始己经按从小到大顺序排序排好。在插入时,首先要查到第一个大于恃插入数的数组下标,即当待插入元素小于数组中当前元素时,记下数组的当前下标p,并结束循环,故第一空目的是为了记下数组下标,应填p=i;插入排序的第二部是将大于待插入元素的所有元素都向后移动—位,故在循环时,要从最后一个元素到第p个元素都要后移一位,因此第二空应填>i=p。最后一个循环是将N+1个元素都输出,故最后一空应为i<=N。(注:本题有多种答案,以上仅提供一种)

阅读理解

根据短文内容,从短文后的选项中选出能填入空白处的最佳选项。选项中有两项为多余选项。

Culture shock is a special disease for people who have suddenly moved to a foreign country.   小题1:  .

Culture shock is caused by the anxiety that results from losing all familiar signs of social communication.小题2:    When to shake hands and what to say, when we meet people, when and how to give tips, how to do shopping, when to accept and refuse invitations, when to take statements seriously and when not. These signs, which may be words, gestures, facial expressions, or customs, are acquired(获得) by all of us in the course of growing up and as much a part of our culture as the language we speak or the beliefs we accept.  小题3:    .

Now when a person enters a strange culture, all or most of these familiar signs are removed. No matter how broadminded will you may be, a series of supports have been knocked from under you, followed by a feeling of failure in much the same way.小题4: “The ways of the host country are bad because they make us feel bad.” When foreigners in a strange land get together to complain about the host country and its people, you can be sure that they are suffering from culture shock.

Another phrase of culture shock is regression(退化). The home environment suddenly becomes very important. To the foreigner, everything becomes unreasonably beautified. All the difficulties and problems are forgotten and only the good things back home are remembered.   小题5:    .

A.Nowadays a lot of people work at home.

B.The children are taught to respect different cultures .

C.Like most illnesses, it has its own symptoms(病症) and cures.

D.It usually takes a trip home to bring one back to reality.E. First they reject the environment which causes discomfort.

F. Those signs include many ways in which we are used to the situation of daily life.

G. All of us depend on hundreds of these signs, most of which we do not carry on the level of conscious awareness(察觉).

报关编码