问题 单项选择题

有以下程序:
#include <stdio.h>
main()
int c;
while((c=getchar())!='\n')
switch(c-'2')
case 0:
case 1:putchar(c+4);
case 2:putchar(c+4);break;
case 3:putchar(c+3);
case 4:putchar(c+3);break;
printf(''\n'');
从第一列开始输入以下数据(<CR>代表一个回车符):
2743<CR>
程序的输出结果是

A) 66877
B) 668966
C) 6677877
D) 6688766

答案

参考答案:A

解析: 本题主要考查字符输入输出函数getchar和putchar的使用。getchar函数用来从标准输入设备上读入一个字符,putchar(c)函数是将字符变量c中的字符输出到标准输出设备上,并且字符可以看作整数参与运算。

完形填空
完形填空。
     "I don't like my parents. They always tell me I should  1  this, and shouldn't do that. It often makes 
me unhappy,"said Zhang Li, a middle school student. Do you have the same problem  2  ZhangLi? Why
 aren't some parents so  3 ? On one hand, parents do a lot for you. They worry about your choice of
 friends, the food you eat and your study at school.   4   these things are part of your life. Don't blame
(责备) them. They want you to  5  up healthily and happily. On the other hand, you  6  introduce your
 friends to your parents. Let them  7  you are making good friends.  8  them If you stay outside  9  than 
usual. Don't always argue    10  them. Talk about your ideas with them. You'll understand them when
 you become a parent in the future.
( )1. A. study    
( )2. A. about    
( )3. A. friendly
( )4. A. Both    
( )5. A. stay    
( )6. A. shouldn't
( )7. A. know    
( )8. A. Surprise
( )9. A. early    
( )10. A. with    
B. make      
B. as        
B. unpleasant
B. Whole    
B. wake      
B. should    
B. look      
B. Remember  
B. late      
B. for      
C. do      
C. like    
C. scared  
C. All    
C. keep    
C. must    
C. think  
C. Call    
C. earlier
C. in      
D. learn  
D. to      
D. busy    
D. Every  
D. grow    
D. needn't
D. think  
D. Talk    
D. later                                            
D. on      
判断题