问题 单项选择题

执行以下程序段后,W的值为______。 int w='A',x=14,y=15 w=((x‖y)&&(w<'a'));

A.-1

B.NULL

C.1

D.0

答案

参考答案:C

解析:[评析] 本题考查的是括号与逻辑运算符的混合运算,其运算优先级为先括号,后逻辑运算符。另外注意“&&”和“||”的“短路”运算。当运算符“&&”左边表达式的值为0时,则右边表达式就不再进行运算,整个表达式的值即为0;当运算符“||”左边表达式的值为非零时,则右边表达式就不再进行运算,整个表达式的值为1。本题先运算表达式“x||y”,由于x=14、y=15均为非零,所以x||y=1。则对于与运算符“&&”,还必须运算其右边的表达式“w<'a'”,由于A的 ASCII码是65,a的ASCII码是97,所以w<'a'的值为1,故整个表达式的值为1。

完形填空
完形填空。
     Beautiful pictures of mountains and forests, clear skies, flying birds, wild animals, silly faces - you can
find them all in one place.  1 ? On a postcard! Have people always sent postcards? No! Before postcards,
people  2   sealed (密封的) letters.
     The  3  for the first decorated (装饰的) postcard came to John P. Charlton in 1861. He thought a simple
card  4  a border would be a great way to send a note. Then in the late 1800s, postcards which had pictures
on them  5 . By law, people had to write their note on the front-on the picture! The back was  6  for the
address. Several years later, England allowed a divided-back (背面隔开的) postcard. Then people could write
their  7  on the back left side. And they put the address  8 . During the early 1900s, the golden age of postcards,
people around the world were more and more  9  picture postcards. In 1908, Americans alone mailed over
677 million postcards.
     Today, postcards are the  10  most popular collection in the world after stamps and coins. You can always
see or get a lot of newly-designed postcards, especially on New Year's Day.
( )1. A. How         
( )2. A. liked       
( )3. A. advice      
( )4. A. above       
( )5. A. happened    
( )6. A. even        
( )7. A. note        
( )8. A. on the front
( )9. A. surprised at
( )10. A. first      
B. When         
B. hated        
B. picture      
B. with         
B. changed      
B. only         
B. word         
B. on the back  
B. interested in
B. second       
C. Why        
C. found      
C. idea       
C. under      
C. ended      
C. still      
C. address    
C. on the left
C. expected by
C. third      
D. Where        
D. lost         
D. card         
D. for          
D. appeared     
D. ever         
D. letter       
D. on the right                  
D. worried about
D. fourth       
问答题 简答题