问题 填空题

有下列程序: #include<stdio.h> main() { char c; while((c=getchar())!=’,’)putchar(++c); } 程序运行时,如果从键盘输入:A,B,<CR>,则输出结果为______。

答案

参考答案:B

解析: 因为c是字符类型变量,它只能接收一个字符,所以c=A,字符型变量在参与算术运算的时候是用其相应的ASCII码参与运算的,这样++c得到字母B的 ASCII码,用putchar函数输出是输出其相应的字符,所以是B。

阅读理解

阅读理解。

    A man is going to open a shop selling hats. He wan-ted a good sign to put over his shop. He wrote:

JOHN BROWN HATTERMakes and Sells Hatsfor Ready Money      

    The first friend gave him the advice that the word"hatter" wasn't needed. So John crossed out the

word  " HATTER" . Then he came to another friend for advice.This friend said that it was not polite to

say"for readymoney". So he crossed out" for ready money". The signnow said :JOHN BROWNMakes

and Sells Hats    

    One day a friend was passing his shop. He saw thissign and said that when a man bought a hat, he

didn'tcare who made it. So John crossed out that word , too.      

    But when  another friend  saw " John  Brown  SellsHats" ,he said, " Of course you sell hats. No one

thinksyou give them away for free. " So, at last the sign read :JOHN BROWN

1 ." For ready  money" means _____.    

A. pay for the hat here when you buy it    

B. if you buy the hat you can pay for it in a few days    

C. hats here are only for the people with much money

2. How many friends gave John some advice on how to write the sign?    

A. Three.        

B. Four.        

C. Two.

3._____was crossed out first.    

A. "John Brown Sells Hats"    

B. " Hatter"    

C. "for Ready Money"

4. Each friend has_____thought.    

A. no        

B. the same      

C. his own

5. This story tells us that____.    

A. it isn't possible to please everybody    

B. it's easy to sell hats    

C. sellers must please everybody

填空题