问题 单项选择题

有以下程序
#include<stdio.h>
main()
int i,s=0,t[]=1,2,3,4,5,6,7,8,9;
for(i=0;i<9;i+=2)s+=*(t+i);
printf("%d\n",s);

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

A.25
B.20
C.45
D.36

答案

参考答案:A

解析: 本题考查的是通过数组首地址引用数组之素。当数组名出现在表达式中时,它类似于一个指针常量,该指针始终指向该数组第1个元素的位置,它的指向不能被改变。但它又与普通的指针常量有所区别:对数组名使用sizeof运算符时,得到整个数组所占内存的大小;而对于指针常量,在TC中返回的始终是2(TC中,一个指针占2个字节的内存)。所以,要获得数组t的第i个元素的内容,既可以使用常规的t[i]表达式,也可以将数组名t看作一个指针常量,使用表达式*(t+i)来获取数组t的第i个元素的内容。在本题中,for循环会循环5次,循环变量i从0开始每次增加2,所以s=t[0]+ t[2] + t[4] + t[6] + t[8]=25。

完形填空
完形填空
       One afternoon, I went to pick up my mother from work.I got there a little early, so I   1   my car by a
small park, and   2   for her.
       As I looked outside the car window, I saw a little boy, around two years old, running   3   on the grass as his mother   4   from a short distance. The boy had a big smile on his face as if he had just been   5    free from some sort of prison .  The boy would then fall to the grass ,     6   up ,   without looking back at his
mother , run as   7   as he could ,again , still with a smile on his face ,as if nothing had happened .
       At that moment, I thought to myself , "why aren't most adults this way ?" Most adults, when they fall
down, make a big deal out of it and don't even   8   a second attempt. They would be so   9   that they
would not try again if someone saw them fall .Or , because they fall , they would find a good   10   for
themselves that they're not fit for it . They would end up too afraid to attempt again for fear of failure.
       However, with kids, when they fall down, they don't consider their falling down as a failure, instead,
they treat it as a   11   experience. They try again and again until they   12   .The answer must be that they
have not connected"falling down" with the word "failure". As a   13  , they are not discouraged in any way .
Besides, they   14   think to themselves that it's quite okay to fall down and that it's not wrong to do so. In
other words ,they allow themselves to make   15   , so they remain energetic.
I was deeply impressed by the boy's persistence (坚持不懈) and the manner in which he did.
( )1. A. left  
( )2. A. waited  
( )3. A. carefully  
( )4. A. w atched  
( )5. A. cut  
( )6. A. hold   
( )7. A. well   
( )8. A. make  
( )9. A. confused  
( )10.A. cause   
( )11.A. learning  
( )12.A. progress  
( )13.A. decision  
( )14.A. hardly   
( )15.A. mistakes   
B. stopped  
B. cared   
B. anxiously   
B. noticed   
B. kept   
B. get    
B. long   
B. provide   
B. embarrassed  
B. sign   
B. running   
B. improve   
B. result   
B.perfectly   
B. choices             
C. repaired
C. prepared
C. freely
C. surveyed
C. found   
C. end   
C. fast  
C. practice
C. exhausted
C. chance
C. teaching
C. achieve
C. reason
C. probably
C. plans            
D. drove        
D. looked      
D. easily      
D. supported    
D. set          
D. pick        
D. soon        
D. discover    
D. surprised    
D. excuse      
D. falling      
D. succeed      
D. matter      
D. nearly      
D. wishes                     
单项选择题 A型题