问题 单项选择题

以下for语句中不是死循环的是( )。

A. for(int i=0;i<1;++i;

B. for(int i=0;;++i;

C. for(int i=1;i>0;++i;

D. for(;;);

答案

参考答案:A

解析:本题考查循环语句for的使用。for循环的一般格式为for(初始化部分;终止条件判断部分;迭代部分){ 循环体;}。  说明如下:for循环开始时,首先执行初始化操作,然后判断终止条件是否满足,如果满足,则执行循环体中的语句,最后执行迭代部分。完成一次循环后,重新判断终止条件。注意:在for语句中,如果省略了终止条件判断部分,并且在语句中没有break,或者是终止条件判断部分始终没有终止,都将出现死循环。

完形填空
完型填空。
    Young people are often unhappy when they are with their parents. They say that their parents don't    1   
them. They often think their parents are too strict with them, and they are never given a    2   hand.
    Parents often find    3   difficult to win their children's trust and they seem to forget how they themselves    4   when they were young.
    For example, young people like to do things without much thinking. It is one of their ways to    5   that
they grow up and they can do with any difficult things. Older people worry more easily. Most of them plan
things ahead and don't like their plans to be changed.
    When you want your parents to let you do something, you will have better success    6   you ask before
you really start doing it.
    Young people often make their parents angry by clothes they want, the music they enjoy and something
else. But they don't    7   to cause any trouble. They just feel that in this way they can be cut off from the old
people's world and they want to make a new culture of their own. And if their parents don't like their music
or their clothes or their manner of speech, the young people feel very    8  .
    Sometimes you even don't want your parents to say "   9  " to what you do. You want to stay at home
alone and do what you like.
    If you plan to control your   10 , you'd better win your parents over and try to get them to understand you.
If your parents see that you have high sense of responsibility, they will certainly give you the right to do what
you want to do.
( ) 1. A. remember
(     ) 2. A. helpful 
(     ) 3. A. that    
(     ) 4. A. thought 
(     ) 5. A. learn  
(     ) 6. A. since  
( ) 7. A. mean    
(     ) 8. A. lonely  
(     ) 9. A. Yes    
(     ) 10. A. life  
B. help  
B. useful 
B. them  
B. wanted     
B. see  
B. if    
B. care 
B. happy 
B. No    
B. work  
C. understand  
C. free      
C. one      
C. needed    
C. find      
C. because     
C. like      
C. worried  
C. Sorry    
C. study    
D. like          
D. strong        
D. it            
D. felt          
D. show                            
D. though        
D. decide        
D. strange       
D. That's right 
D. health        
单项选择题