问题 单项选择题

以下合法的字符型常量是【 】。

A.'\x13'

B.'\081'

C.'65'

D."\n"

答案

参考答案:A

解析:C语言的字符常量是用单引号(即撇号)括起来的一个字符。除此之外,在C语言中还允许用以一个"\"开头的字符序列来表示字符常量。其中,形式"\ddd"表示l到3位8进制数所代表的字符;形式"\xhh"表示1到2位16进制数所代表的字符。在本题中‘\x13’表示回车符,是一个字符常量;‘\081’用8进制数所代表的字符,但形式不正确,因为8进制数所表示的字符中不会出现数字"8";‘65’不是一个字符,而是一个十进制数字;"\n"是用双引号括起来的一个字符,表示一个字符串,而不是字符常量。

完形填空
完形填空。
     Peter and James were brothers. One afternoon __1__ the lessons were over, they stayed in school to
help their teacher. They__ 2__ for an hour. Then the teacher said, "Thank you, boys. We will finish the
work tomorrow. Now you must go home."
     When the boys __3__ home, it was seven o'clock. There was light inside their house and the door was
___4__. They could see a man inside, too.
     "Who can it be?" thought Peter. "Father and Mother have gone shopping. They won't be home __5__
eight o'clock."
     When the ___6__ man saw Peter, he smiled and said, "Come in! You don't know me, but I'm your
__7__friend. He  asked me to fetch (取)some money for him." The man did not see James.
     Peter went inside and began talking to the man but James did not. He quietly but quickly ran off to call
the police. He soon found a policeman and __8__ him back to their home. The man was still there, but
when he saw the policeman, he tried to run off. The policeman __9__ him and held his arm.
     Just then Mr. and Mrs. Baker, the boys' parents _10__.
     "No!" said Baker. "I don't know him. He must be a thief. I am glad you have caught him."
( )1. A. if        
( )2. A. studied  
( )3. A. arrived in
( )4. A. open      
( )5. A. at        
( )6. A. away      
( )7. A. father    
( )8. A. brought  
( )9. A. stoped    
( )10. A. returned
B. when        
B. worked      
B. went to    
B. opened      
B. since      
B. out        
B. fathers    
B. bring      
B. stopped    
B. come        
C. before      
C. stayed      
C. got to      
C. opening      
C. until        
C. outside      
C. father's    
C. take        
C. catch        
C. arrive      
D. until      
D. watched    
D. reached    
D. close      
D. after      
D. inside    
D. brother's
D. caught    
D. saw        
D. reached    
单项选择题 A1/A2型题