问题 单项选择题

若执行以下程序时从键盘上输入9,则输出结果是______。
main()

int n;
scanf("%d:",&n);
if(n++<10)printf("%d\n",n);
else printf%d\n",n--);

A.11

B.10

C.9

D.8

答案

参考答案:B

解析:[评析] n++是在语句结束后再加1,因此,if语句中相当于判断的是9<10,当然是执行if语句后面的printf语句,而这时,因为if语句被执行,n的值也被加1,所以在打印时,n值为10,而n--是在printf语句执行完毕后再减1的。

完形填空

根据短文内容和首字母提示,在下文空格处填入适当的词使短文完整。(每空一词)

Japanese people often ask people what blood group they are. This is b ___小题1:___ they believe that a person’s blood group says a lot about their character and personality. The Japanese also believe that k___小题2:___ blood group can help them decide that if a person will be a person’s good friend. It is strange that this idea is so popular in Japan because it is not a traditional idea, but a m___小题3:___ one. Blood groups were only d___小题4:___ in 1901 and in 1916 a Japanese doctor suggested that blood groups were related to temperament (气质、性情).

In 1927, a writer did a large study of people and wrote a guide to blood groups. He said that people f___小题5:___ blood group O are calm, patient and in control of their emotions (情绪). They are f___小题6:___ of self-confidence but are also quiet. People from blood group A are gentle and careful, worry a lot, find it hard to make a d___小题7:___, and do not like arguments. People from blood group B are cheerful and “independent”(独立). They like to talk and do things w___小题8:___ needing help from others. Blood group AB is quite a strange group. These people may seem like people from blood group B but they are actually m___小题9:___like people from blood group A. They are shy and confident, trustworthy (可信赖的)and like to help others. The Japanese also think that your blood group a___小题10:___ your choice of job and even your choice of marriage partner!

单项选择题