问题 单项选择题

下列程序的运行结果为 #include<iostream,h> Template class TT> class FF { TT a1,a2,a3; public; FF(TTb1,TTb2,TTb3){a1=b1;a2=b2;a3=b3;} TT Sum(){return a1+a2+a3;}}; void main() { FF<int>x(in[(1.1),2,3),y(int(4.2),5,6); cout <<x.Sum() <<‘‘ <<y.Sum() <<end1;}

A.6.1 15.2

B.6 15

C.615.2

D.6.1 15

答案

参考答案:B

解析: 本题考查模板函数的应用,表达式int(1.1)和int(4.2)是将1.1和4.2强制转换为整型。

补全对话,情景问答
从II 栏中选出I 栏中每句话的正确答语。
                     I                                         
( )1. What's the matter?                    
( )2. What are you doing?                   
( )3. How long can I keep the physics book? 
( )4. What class are they having?           
( )5. What time does the class begin?       
( )6. Why do you like English?              
( )7. Is there a computer in your study?    
( )8. How do you usually go to school?      
( )9. How often do you go to the library?   
( )10. How can I get to Zhongshan Avenue?    
                     II                                              
A. They're having a music class.             
B. Very often.                                 
C. Sorry, I can't hear you. The line is bad.    
D. At ten o'clock.                              
E. Turn right at the third turning.              
F.  I'm making cards.                                                     
G. Yes, there is.                                
H. Two weeks.                                  
I. I usually go to school by bus.                
J. Because it's easy and interesting.        
多项选择题