问题 单项选择题

有以下程序 #include <stdio.h> void fun(int a[],int n) { int i,t;for(i=0;i<n/2;i++) {t=a[i]; a[i]=a[n-1-i]; a[n-1-i]=t;} } main() {int k[10]={1,2,3,4,5,6,7,8,9,10},i;fun(k,5); for(i=2;i<8;i++) printf("%d",k[i]);printf("\n"); } 程序的运行结果是______。

A.345678

B.876543

C.1098765

D.321678

答案

参考答案:D

解析:[评析] 在主函数中,定义了一维数组k,并通过调用fun函数将形参数组a指向实参数组k所在的存储单元,这样,a和 k共用同一存储单元,所以对数组a的元素值的改变相当于对相应数组k的元素值的改变。在fun函数中,通过for循环对数组元素a[0]与a[4]、a[1]与a[3]的值分别作了交换,也即相当于主函数中k[0]与k[4]、k[1]与k[3]的值分别作了交换,此时k中各元素的值为5,4,3,2,1,6,7,8,9,10,故输出k[2]到k[7]的值为321678。

完形填空
完形填空。
     It was the last day of school and I planned to travel to my friend's hometown. I hadn't seen him for
years and this was a good  1  to meet him again.
     I was busy at school so it was rather  2  when I came back home. It was already 10 o'clock at night.
Time was running out. After a hurried meal I left.  3  I found a taxi very soon. Asking the driver to drive me
fast to the station, I relaxed for a while, imagining what my friend looked like now. I was soon at the station
and was sure that I would be able to  4  the train. Unfortunately, I fell on the way and lost some time. To my
complete  5 , when I reached the platform, I saw that the train had just left! It was the last train so I had to
  6  home.
     My mother was glad to see me back as she had a feeling about my trip. But I was unhappy. I tried to relax
and went to bed but I had a  7  sleep. The next morning I was very tired. As I was having breakfast the  8  
arrived. I read over the pages and was shocked to  9  that the train I missed had had an accident. How  10  
I was that I missed the train!
( )1. A. sign        
( )2. A. strange     
( )3. A. Finally     
( )4. A. stop        
( )5. A. satisfaction
( )6. A. call        
( )7. A. deep        
( )8. A. newspaper   
( )9. A. find        
( )10. A. hopeful    
B. chance  
B. cold    
B. Suddenly
B. see     
B. hope    
B. leave   
B. bad     
B. ticket  
B. hear    
B. thankful
C. sense    
C. late     
C. Strangely
C. catch    
C. surprise 
C. reach    
C. great    
C. mild     
C. feel     
C. careful  
D. dream  
D. quiet  
D. Luckily
D. miss   
D. joy                                               
D. return 
D. heavy  
D. train  
D. remember
D. painful
单项选择题