问题 填空题

下列给定程序中函数fun()的功能是:从低位开始取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。例如,当s中的数为7654321时,t中的数为642。 请改正程序中的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。 试题程序: #include<stdio.h> #include <conio.h> /*************found**************/void fun(long s,long t){ long s1=10; s/=10; *t=s%10; /*************found**************/while(s<0) { s=s/100; *t=s%10*s1+*t; s1=s1*10; } } main() { long s, t;clrscr();printf("\nPlease enter s: "); scanf("%ld",&s);fun(s,&t);printf("The result is: %ld\n ",t); }

答案

参考答案:错误:void fun(long s,long t) 正确:void fun(long s,long *t)

解析:(2) 错误:while(s<0) 正确:while(s>0) 本题考查函数调用方式和while循环语句中条件限制的方法。主函数中fun()的调用方式说明fun()函数的参数应当为指针类型,所以void fun(long s,long t)正确的写法应该是void fun(long s,long *t)。

阅读理解

B

Our eating habits(习惯) are very important for good health and a strong body. There are times when most of us would rather eat sweets and ice-cream than meat and rice. Sweets and ice-cream are not bad if we eat them at the end of a meal. If we eat them before a meal, they may take away our appetite(食欲). It is important for us to eat our meals at the same time each day. When we feel hungry, it is a sign that our body needs food. When we feel angry or excited, we may not want to eat. A long time ago, in England, some judges(法官) used to decide whether a man was telling the truth by giving him some dry bread. If the man could not eat the bread, it showed that he was telling lies. Although this seems very strange and rather foolish, it is indeed a very good way of finding out the fact. A man who is worrying about something has difficulty in eating anything dry. Because he is worrying, he loses his appetite and does not want to eat.

61. We must have good eating habits because ____.

A. we want to eat more                B. we want to enjoy our meals

C. we want to be healthy and strong      D.we want to have a good appetite.

62. It is good to eat sweets and ice-cream ____.

A. when we are hungry . B. when we want to  C. after the meal D. before the meal

63. We'd better have our meals ____.

A. at the same time each day         B. when our work is over

C. when the meal is still hot          D. when every one of the family is home

64. According to the judges in England, if a man tells a lie, he____.

A. eats dry bread easily          B. eats dry bread with difficulty

C. eats a lot of dry bread         D. drinks milk with difficulty

65. A man who is angry ____.

A. has a better appetite          B. likes to tell lies

C. likes to eat ice-cream         D. has a poor appetite

多项选择题