问题 填空题

以下程序运行后的输出结果是______。 #include<string.h> main() {char ch[]="abcd",x[4][4];int i; for(i=0;i<4;i++)strcpy(x[i],ch); for(i=0;i<4;i++)printf("%s",&x[i][i]); printf("\n"); }

答案

参考答案:abcdabcdabcdabcdbcdabcdabcdcdabcdd

解析: 本题考查的是二维数组。本题定义了一个4行4列的二维数组x,通过for循环以及strcpy函数将字符数组cb的值’abed’分别复制到了x数组的每一行,使得二维数组每一行的值均为’abcd’,再通过第二个for循环输出每一行上所要求输出的字符串,当i=0时。输出以x[0][0]的地址为首地址的字符串“abed”;当x=1时,输出以x[1][1]的地址为首地址的字符串“bed”;当x=2时,输出以x[2][2]的地址为首地址的字符串“cd”;当x=3,输出以x[3][3]地址为首地址的字符串“d”。

阅读理解

It is the 22nd century (世纪)and it is very popular to change people’s bodies.

Mr. Smith decided to change his body. He changed his big nose to a small one, and his old and gray hair to short and blond hair. He also bought new green eyes, new hands, new arms, new knees and new feet. Mrs. Smith was happy because Mr. Smith’s new feet didn’t smell as bad as his old feet.

However, something bad happened. One morning, Mr. Smith woke up and his new nose didn’t work. The next morning he couldn’t hear anything. Then his new blond hair went gray, and his new knees didn’t move. And finally he could see nothing with his green eyes.

It was really terrible. Mr. Smith wanted his old body back. However, he had to pay 100,000 euro (欧元)for his old body.

It was expensive but Mr. Smith still got his own body back. He would never follow the fashion.

根据短文内容,选择正确答案,(5分)

小题1:What was Mr. Smith’s new hair like?

A.Short and gray.

B.Long and gray.

C.Short and blond.

D.Long and blond.小题2:Why was Mrs. Smith happy?

A.Because Mr. Smith’s new look was cool.

B.Because Mr. Smith’s new feet were small.

C.Because Mr. Smith looked younger than before.

D.Because Mr. Smith’s new feet didn’t smell bad.小题3:What did Mr. Smith think of his new body at the beginning?

A.Strange.

B.Fantastic.

C.Terrible.

D.Clean.小题4:Which part of Mr. Smith’s body went wrong first?

A.The new nose.

B.The new eyes.

C.The new knees.

D.The new ears.小题5:What did Mr. Smith pay 100,000 euro for?

A.Buying his new nose.

B.Getting his old eyes.

C.Buying another new body.

D.Getting his old body back.

单项选择题