问题 单项选择题

下面程序段的运行结果是
char *p="abedefgh":
p+=3;
printf("070 d\n",strlen(strcpy(P,"ABCD")));

A) 8
B) 12
C) 4
D) 7

答案

参考答案:C

解析: p+=3使指针p指向字符'd',strcpy函数的功能是把后面的字符串复制到p指针指向的空间。strlen函数的功能是求字符串的长度,并返回字符个数,不计最后的'\0',结果为4,即字符串“ABCD”的长度。

阅读理解

The final exam comes in June. When the exam ends(结束) , the summer vacation begins. Boys and girls have about two months to relax. The summer vacation is the best time of the year for most children. The weather is usually fine. They can swim, go to summer camps or visit other places with their parents.

Of course, the beaches  are  good places for relaxing.  Some children are lucky(幸运的)  to live near the beach. They can often play in the water. But for the children far(远的)from the sea, they go to the beaches for one or two weeks with their parents.

Why do children like spending their summer vacation on the beaches? It is because they like the sand(沙) , the sun, the cool wind and the sea water. There are lots of new things to see, nice things to eat, and exciting things to do.

小题1:School children usually have exams     .

A.in June

B.after June

C.before June

D.In July小题2:The summer vacation is about     .

A.two weeks

B.two months

C.three months

D.Two days小题3:Why do children like summer vacation?

A.Because the weather is fine.

B.Because it is long.

C.Because the weather is fine and they can have lots of activities.

D.Because they can have exams.小题4:Children near the beach can enjoy the sea____

A.in the evening

B.for one or two weeks

C.for two months

D.very often小题5:Which of the following is NOT right?

A.Children like going to the beaches only because they can see lots of new things.

B.Children like summer vacation best.

C.Children can swim and enjoy the sand, wind, and water on the beaches.

D.Children like to spend their summer vacation on beaches.

判断题