问题 填空题

以下程序运行后的输出结果是______。
  main( )
   int i,m=0,n=0,k=0;
   for(i=9; i<=11;i++)
   switch(i/10)
    case 0: m++;n++;break;
    case 10: n++; break;
    default: k++;n++;
   
   printf("%d %d %d\n",m,n,k);

答案

参考答案:1 3 2

解析: 初次进入循环时,i的值为9,i/10值为0,故执行“m++;n++;break;”语句序列,m值变为1,n,值变为1。再次执行循环,i值为10,i/10值为1,执行“k++;n++;”语句序列,k值变为1,n值变为2。继续执行循环,i值为11,i/10值为1,执行“k++;n++;”语句,k值变为2,n变为3。

阅读理解

阅读理解。

     How did ancient people tell time?

     ◇Natural ways of keeping time

      In ancient time, people had to use the sun and the moon to tell time. They got up when the sun came

up and worked in the fields until the sun went down.

     ◇Man-made things

      The sand clock is made of two glass balls joined in a narrow neck. The top ball was filled with sand.

The sand slowly moved through the neck into the bottom (底部) hall. People knew the time by watching

how much sand fell to the bottom ball. People also made the water clock. They made a small hole near the

bottom of a pot. When the water in the pot dripped (滴) out, marking (刻度) inside the pot showed how

much fame passed.

     ◇Body clocks in living things

      Animals' body clock

      Animals don't need clocks to know time. They have their body clocks. Birds know when to fly to

warmer places before winter. Some animals know when to keep more food for the winter. Some fish know

when it's time to move up the river and lay eggs.

     Plants' own chock

     Plants have their own clocks to keep time. Plants know when to open flowers or when to drop their

leaves.

     Body clock in human beings

     People also have their own body clocks. When we get used to our lives, our body clocks can be very

exact. It can tell us when it's time to wake up. It can also tell us when to eat or to go to sleep.

1. How could an ancient farmer know when to go back home from the field in the daytime?

A. By looking at the moon.

B. By the sand clock or the water clock.

C. By looking at the sun.

D. By feeling whether tired or not.

2. According to the passage, how can animals know time?

A. They use body clocks.

B. They ask other animals.

C. They use the sun and the moon.

D. They make something to tell time.

3. How many kinds of living things with body clocks are mentioned here?

A. Two.

B. Three.

C. Four.

D. Six.

4. In what way is the sand clock the same as the water clock in telling time?

A. Both of them have a neck.

B. Both of them have two glass balls.

C. Both of them can be used only once.

D. Both of them give the time by quantity (数量).

5. The passage is mainly about _______.

A. man-made clocks

B. nature's clocks

C. time and clock

D. how people keep time

判断题