问题 单项选择题

有以下程序
#include<stdio.h>
main()
int i=5;
do
if(i%3==1)
if(i%5==2)
(printf("%d",i);break;
i++;
while(i!=0);
printf("\n"1);

程序的运行结果是______。

A.*7
B.*3*5
C.*5 D.*2*6

答案

参考答案:A

解析: 本题考查的是break语句。do…while循环是“先执行,后判断”,所以无论条件如何,它都至少会执行一遍。程序首先初始化变量i为5,然后进入do…while循环体,首先判断(i%3==1),因为5%3=2,所以if条件不满足,跳过下面的if语句,执行i++,i变为6。第1遍循环结束,判断(i!=0)为真,继续循环。现在i%3=6%3=0,所以if语句还是不被执行,继续i++,i变为7,仍然满足(i!=0),继续循环。第3遍循环i%3=7%3=1,满足条件(i%3==1),继续判断条件i%5==2 成立,即输出*7,然后执行break语句跳出循环。

单项选择题
完形填空
完形填空。
      A rich American went into a shop in London. He wanted very much to   1   a nice-looking watch. He saw
a watch and liked it so much   2   he decided to buy it. But the owner of the shop   3   five hundred dollars for
it.   4   the American was   5   whether to buy it or not, a young man suddenly came into the shop, took the 
  6   out of the owner's hand and ran out. It all   7   in a few seconds. When the owner ran out   8   the street,
the young man was already   9   among the people. The American went  10
      At the next corner, he saw the young man  11  the stolen watch in his hand. "Do you want to buy a fine
watch, sir?" he said in a low voice, "it's  12  a hundred dollars."
      "The young man doesn't know  13  I saw him stealing the watch just now," he  14 . The American paid
at once and went  15  back to his room with the watch. His friend took a  16  at the watch and started  17  
immediately. He said, "You are  18 . This watch isn't worth  19  ten dollars. I'm  20  the shop owner and the
young man planned all this together."
( )1. A. mend       
( )2. A. and       
( )3. A. asked     
( )4. A. Though     
( )5. A. wondering 
( )6. A. money     
( )7. A. recorded   
( )8. A. of         
( )9. A. discovered 
( )10. A. away       
( )11. A. with       
( )12. A. still     
( )13. A. how       
( )14. A. asked     
( )15. A. sadly     
( )16. A. picture   
( )17. A. laughing   
( )18. A. lucky     
( )19. A. many       
( )20. A. sorry     
B. get        
B. then      
B. wanted     
B. After      
B. examining   
B. watch      
B. supplied  
B. on         
B. lost       
B. on         
B. without    
B. only       
B. why        
B. called     
B. happily    
B. look       
B. crying     
B. right      
B. small      
B. pleased    
C. sell           
C. because     
C. needed       
C. While        
C. explaining    
C. present       
C. happened    
C. across      
C. separated    
C. in          
C. enjoying    
C. already      
C. where        
C. thought      
C. angrily      
C. work        
C. working      
C. a fool       
C. even        
C. surprised  
D. make         
D. that       
D. paid      
D. When      
D. replying     
D. picture   
D. fetched     
D. into        
D. punished                
D. up          
D. making      
D. nearly      
D. that      
D. found       
D. carefully   
D. prize       
D. operating   
D. a man       
D. much        
D. sure