问题 单项选择题

有如下程序: #include<iostream> using namespace std; int fun(int a, int b) {return(++a*b++);} void main() { int x=3,y=4,z=5,r; r=fun (fun (x,y),z); cout<<r>>endl; cout<<x<<endl; cout<<y<<endl; } 该程序的输出的结果是( )。

A.85 3 4

B.60 3 4

C.126 4 5

D.85 4 5

答案

参考答案:A

解析: 注意运算符“++”在变量前与后的区别;fun()函数采用值传递的方式,所以调用前后x和y的值不会发生变化。

完形填空
完形填空。
     A rich father wanted to show his son how poor people can be. One day, he took his young son __1__
  a trip to the country. They __2__ a day and night in the farm of a very __3__ family. When they got back
  from their trip the father asked his son, "how was the __4__ ?"
     "Very good, Dad!"
     "Did you see how poor people can be?" the father asked.
     "Yeah!"
     "And what did you __5__ ?"
     The son answered, "I saw that we have a dog at home, but they have four. We have a pool that
 reaches to the middle of the garden. They have a small river that has no __6__ . We have expensive
 lamps in the garden, but they have the __7__ . Our…"
     When the little boy was finishing, his father was __8__ .
     His son added, "Thanks, dad, for showing me __9__ poor we are!"
     Isn't it true that it all depends on the way you look at things? If you have love, friends, family, health,
 good humor and a positive attitude (积极的态度) toward life, you've got __10__ !
( ) 1. A. on          
( ) 2. A. took        
( ) 3. A. rich         
( ) 4. A. trip         
( ) 5. A. say         
( ) 6. A. top          
( ) 7. A. suns         
( ) 8. A. wordless     
( ) 9. A. what        
( ) 10. A. nothing    
B. in      
B. paid    
B. poor    
B. idea    
B. learn    
B. bottom  
B. stars      
B. happy    
B. how      
B. something  
C. at      
C. spent    
C. good    
C. way      
C. remember  
C. end      
C. tents    
C. excited  
C. why      
C. anything  
D. to            
D. cost          
D. happy        
D. life          
D. write        
D. cover        
D. cages        
D. pleased      
D. when          
D. everything    
判断题