问题 单项选择题

设有以下语句:
char x=3,y=6,2;
z=x^y<<2;
则z的二进制值是

A) 00010100
B) 00011011
C) 00011100
D) 00011000

答案

参考答案:B

解析: 本题考查两个位运算符。按位异或运算符"^"是双目运算符,其功能是参与运算的两个数对应的二进位相异或,当两对应的二进位相异或时,结果为1。左移运算符"<<"是双目运算符,其功能是把"<<"左边的运算数的各二进位全部左移若干位,由"<<"右边的数指定移动的位数,高位丢弃,低位补0,并且"<<"运算符的优先级高于"^"。

完形填空
完型填空。
     Once, in a small village, lived a family with eight children. Two of the children loved   1   very much,
but the family was so poor that it was impossible to send   2   of them to study at the art college at the
same time. After many discussions, the two boys finally   3   a plan. They would toss (抛) a coin. The
loser would   4   down into the mines (煤矿) and, with his earnings (赚得的钱),   5   his brother studying
at the college. Then, when the brother who won the toss finished his studies, after four years, he would
support   6   brother studying at the college.
      James won the toss and Jack went down into the mines. James worked with all his heart and his
paintings were much   7   than those of most of his teachers, and by the time he   8  , he was beginning
to make a lot of money for his paintings. 
        9   James returned, the family held a big dinner for his great success. Soon after the meal began,
James  10   up from his seat to drink a toast to his dear  11 . He said, "Jack, now you can go to the art
college and your  12  will come true. I will take care of you." But Jack said  13 , "Brother, the four years
in the mines has done too much to my hands, so it' s too 14 . Now I can' t even hold a glass."
     To show his great love and respect, James drew his brother' s hands with  15  towards the sky. He
called his drawing "The Praying Hands", which became very famous years later.
( )1. A. painting      
( )2. A. any              
( )3. A. looked out   
( )4. A. run             
( )5. A. support        
( )6. A. other           
( )7. A. better          
( )8. A. arrived        
( )9. A. Before        
( )10. A. picked        
( )11. A. brother        
( )12. A. way             
( )13. A. happily         
( )14. A. early           
( )15. A. legs          
B. books         
B. all               
B. worked out    
B. jump              
B. agree           
B. another         
B. worse           
B. graduated      
B. When            
B. turned           
B. sister        
B. idea              
B. surprisedly        
B. late            
B. feet        
C. school       
C. both            
C. took out    
C. come            
C. follow        
C. the other     
C. cheaper        
C. walked      
C. Though          
C. looked           
C. father    
C. dream            
C. angrily        
C. good          
C. arms      
D. money          
D. neither            
D. got out     
D. go                  
D. let              
D. others         
D. older           
D. waited                       
D. While              
D. stood              
D. mother     
D. practice            
D. softly        
D. helpful         
D. fingers    
问答题