听力原文:M: So, what exactly are you doing to protect the elephants here?
W: Well, we have managed to raise a lot of money for this project. A lot of it is being used to compensate farmers for the damage that elephants do to their crops.
M: Hog, does that protect the elephants?
W: since the elephants cause damage to the crops, farmers are often tempted to go out and kill the elephants.
M: I see. So, the farmers don't have a real problem with the elephants until the elephants start eating the crops. But why do the elephants do that?
W: Well, there aren't enough trees to provide them with food on the land that has been reserved for them.
M: Mm. But: if you successfully protect the elephants, their numbers will grow and they will need more food, that means that they'll need more land.
W: That's true, but we've solved that problem too. What we do is move some elephants to reservations where there are relatively few.
M: So that's where you spend another large proportion of the money you raise.
W: Actually, it isn't very expensive because we share the cost with the people who run the other reservations.
M: I see. How do you decide which elephants to move?
W: We use two criteria. The first is that we maintain the genetic diversity of the elephant herd. The second is that we transport the more aggressive members of the herd, which results in us spending less money compensating farmers.
M: Are there any plans to expand the reservation?
W: We have allocated some money to land purchases, but such purchases could have a detrimental effect on the local human population so we rarely do it.
M: What kinds of research are you doing on the elephants here?
W: We're mainly studying the way that elephants interact with each other within a herd.
M: I see. Well, thanks very much for your time.
W: My pleasure.
(20)
A.Water.
B.Crops.
C.Money.
D.Trees.
第1题
已知在in.dat中存有若干个(个数<200)四位数字的正整数,函数ReadDat读取这若干个正整数并存入数组XX中。请编制函数CalValue,其功能要求: 1.求出该文件中共有多少个正整数totNum; 2.求这些正整数右移1位二进制位后,产生的新数是奇数的数的个数totCnt,以及满足此条件的这些正整数(右移前的值)的算术平均值totPjz。最后main函数调用函数 WriteDat把所求的结果输出到文件out.dat中。 注意:部分源程序存放在test.c文件中。 请勿改动数据文件in.dat中的任何数据,主函数main、读函数ReadDat和输出函数WriteDat的内容。
第2题
文件IN65.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat()是读取这若干个正整数并存入数组xx中。请编制函数CalValue(),其功能要求是:(1)求出这个文件中共有多少个正整数totNum。
(2)求出这些数中的各位数字之和是奇数的个数totCnt,以及满足此条件的这些数的算术平均值totpjz。最后调用函数WriteDat()把所有结果输出到文件OUT65.DAT中。
注意:部分源程序已给出。
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
include<stdio. h>
include<conio. h>
define MAXNUM 200
int xx [MAXNUM];
int totNum=0;
int totCnt-0;
double totPjz=0.0;
int ReadDat (void);
void WriteDat(void);
void CalValue (void)
{
}
void main()
{
int i;
clrscr ();
for (i=0; i<MAXNUM; i++)
xx[i]=0;
if (ReadDat ())
{
printf ("数据文件IN65.DAT不能打开!\007\n");
return;
}
CalValue ();
printf ("文件IN65. DAT中共有正整数=%d个\n", totNum);
printf ("符合条件的正整数的个数=%d个n", totCnt);
printf ("平均值=%.21f\n", totPj z);
WriteDat ();
}
int ReadDat (void)
{
FILE *fp;
int i=0;
if ((fp=fopen ("IN65. DAT", "r") ) ==NULL)
return 1;
while (! feof (fp))
{
fscanf (fp, "%d", &xx [i++] );
}
fclose (fp);
return 0;
}
void WriteDat(void)
{
FILE *fp;
fp=fopen ("OUT65. DAT", "w" );
fprintf (fp, "%d\n%d\n%.2,1f\n", totNum, totCnt, totPj z);
fclose (fp);
}
第3题
在文件in.dat中存有若干个(个数<200)四位数字的正整数,函数ReadDat读取这若干个正整数并存入数组XX中。请编制函数CalValue,其功能要求:1.求出该文件中共有多少个正整数totNum;2.求出这些正整数中的各位数字之和是偶数的数的个数totCnt,以及满足此条件的这些正整数的算术平均值totPjz。最后main函数调用函数WriteDat把所求的结果输出到0ut.dat文件中。 注意:部分源程序存放在test.c文件中。 请勿改动数据文件in.dat中的任何数据,主函数main、读函数ReadDat和输出函数WriteDat的内容。
第4题
已知在in.dat中存有若干个(个数<200)四位十进制数字组成的正整数,函数ReadDat读取这若干个正整数并存入数组 xx中。请编制函数CalValue,其功能要求:1.求出该文件中共有多少个正整数totNum;2.求这些正整数右移1位二进制位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些正整数(右移前的值)的算术平均值totPjz。最后main函数调用函数WriteDat把所求的结果输出到out.dat文件中。 注意:部分源程序存放在test.c文件中。 请勿改动数据文件in.dat中的任何数据,主函数main、读函数ReadDat和输出函数WriteDat的内容。
第5题
已知在in.dat中存有若干个(个数<200)1四位十进制数字组成的正整数,函数ReadDat读取这若干个正整数并存入数组 XX中。请编制函数CalValue0,其功能要求: 1.求出该文件中共有多少个正整数totNum; 2.求这些正整数右移1位二进制位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些正整数(右移前的值)的算术平均值totPjz。最后main函数调用函数WriteDat把所求的结果输出到out.dat文件中。 注意:部分源程序存放在test.C文件中。 请勿改动数据文件in.dat中的任何数据,主函数main、读函数ReadDat和输出函数WriteDat0的内容。
第6题
已知在文件IN20.DAT中存有若干个(个数〈200)4位数字的正整数,函数ReadDat()的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue(),其功能要求:(1)求出这文件中共有多少个正整数totNum:(2)求㈩这些数中的各位数字之和是偶数的数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz,最后调用函数WriteDat()把所求的结果输出到文件OUT20.DAT中。
注意:部分源程序已给出。
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
试题程序:
include〈stdio.h>
inciude〈conio. h>
define MAXNUM 200
int xx [MAXNUM];
int totNum = O; /* 文件 IN20.DAT 中共有多少个正整数 */
int totCnt = 0; /* 符合条件的正整数的个数 */
double totPjz = 0.0; /* 平均值 */
int ReadDat (void);
void Writedat (void);
void CalValue ()
{
}
main ()
{
int i;
clrscr ();
for(i = 0; i 〈 MAXNUM; i++)
xx[i]= 0;
if (Readdat ())
{
printf ("数据文件IN20.DAT 不能打开 ! \007\n");
return;
}
CalValue ();
printf ("文件IN20. DAT 中共有正整数=%d个\n", totNum);
printf ("符合条件的正整数的个数=%d个\n", totCnt);
printf("平均值=%.21f\n", totPjz);
Writedat ();
}
int Readdat (void)
{
FILE *fp;
int i = 0;
if((fp = fopen("IN20.DAT", "r")) == NULL)
return 1;
while (! feof (fp))
{
fscanf(fp, "%d,", &xx[i++]);
}
fclose(fp);
return 0;
}
void Writedat(void)
{
FILE *fp;
fp = fopen("OUT20.DAT", "w");
fprintf(fp, "%d\n%d\n%.21f\n", totNum, totCnt, totPjz);
fclose (fp);
}
第7题
已知在文件IN13.DAT中存有若干个(个数〈200)4位数字的正整数,函数ReadDat()的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue(),其功能要求: (1)求出该文件中共有多少个正整数totNum; (2)求这些数右移1位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz,最后调用函数WriteDat()把所求的结果输出到文件OUT13.DAT中;
注意:部分源程序已给出。
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
试题程序:
include〈stdio.h>
include〈conio.h>
define MAXNUM 200
int xx [MAXNUM];
int totNum = 0; /* 文件IN13.DAT 中共有多少个正整数 */
int totCnt = 0; /* 符合条件的正整数的个数*/
double totPjz = 0.0; /* 平均值 */
int ReadDat (void);
void Writedat(void);
void CalValue(void)
{
}
main ()
{
int i;
clrscr ();
for(i = 0; i〈 MAXNUM; i++)
xx[i] = 0;
if (ReadDat ())
{
print f ("数据文件 IN13.DAT 不能打开! \007\n" );
return;
}
CalValue ();
printf("文件IN13.DAT 中共有正整数= %d 个\n", totNum);
printf("符合条件的正整数的个数 = %d 个\n", totCnt);
printf("平均值=%.21f\n", totPjz);
Writedat ();
}
int ReadDat (void)
{
FILE *fp;
int i = 0;
if((fp = fopen ("IN13.DAT", "r") == NULL)
return 1;
while(! feof(fp) )
{
fscanf(fp, "%d,", &xx[i++]);
}
fclose{fp);
return 0;
}
void WriteDat(void)
{
FILE *fp;
fp = fopen("OUT13.DAT", "w");
fprintf(fp, "%d\n%d\n%.21f\n", totNum, totCnt, totPjz);
fclose(fp);
}
第8题
已知在文件IN13.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat()的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue(),其功能要求:(1)求出该文件中共有多少个正整数totNum;(2)求这些数右移1位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz,最后调用函数WriteDat()把所求的结果输出到文件OUT13.DAT中。
注意:部分源程序已给出
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
试题程序:
include〈stdio.h>
include〈conio.h>
define MAXNUM 200
int xx [MAXNUM];
int totNum = 0; /* 文件IN13.DAT 中共有多少个正整数 */
int totCnt = 0; /* 符合条件的正整的个数 */
double totPjz = 0.0; /* 平均值 */
int ReadDat (void);
void Writedat(void);
void CalValue(void)
{
}
main ()
{
int i;
clrscr ();
for(i = 0; i〈MAXNUM; i++)
xx[i] = 0;
if (ReadDat ())
{
printf ("数据文件 IN13.DAT 不能打开! \007\n");
return;
}
CalValue ();
printf("文件IN1B.DAT 中共有正整数= %d 个\n", totNum);
printf("符合条件的正整数的个数= %d 个\n", totCnt);
printf("平均值=%.21f\n", totPjz)
Writedat ();
}
int ReadDat (void)
{
FILE *fp;
int i = 0;
if((fp = fopen ("IN13.DAT", "r")) == NULL)
return 1;
while(! feof(fp))
{
fscanf(fp, "%d,", &xx[i++]);
}
fclose(fp);
return 0;
}
void WriteDat(void)
{
FILE *fp;
fp = fopen("OUT13.DAT", "w");
fprintf(fp, "%d\n%d\n%.21f\n", totNum, totCnt, totPjz);
fclose (fp);
}
第9题
已知在文件in70.dat中存有若干个(个数<200)4位数字的正整数,函数ReadDat()是读取这若干个正整数并存入数组xx中。请编制函数CalValue(),其功能要求是:(1)求出这个文件中共有多少个正整数totNum。 (2)求这些数右移一位后,产生的新数是奇数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz。最后调用函数WriteDat()把所有结果输出到文件out70.dat中。
注意:部分源程序已给出。
请勿改动主函数main()、读函数ReadDat()和写函数Wiltedat()的内容。
试题程序:
inc lude<stdio, h>
inc lude<conio, h>
define MAXNUM 200
int xx [MAXNUM];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat (void);
void WriteDat (void);
void CalValue (void)
{
}
void main ()
{
int i;
clrscr ();
for (i=0; i<MAXNUM; i++ )
xx[i] =0;
if (ReadDat ())
{
printf ("数据文件IN70. DAT 不能打开! \007\n" );
return;
}
CalValue ();
printf ("文件IN70.DAT中共有正整数=%d个\n", totNum);
printf ("符合条件的正整数的个数=%d个\n", totCnt );
printf ("平均值=%.21f\n", totPjz);
WriteDat ();
}
int ReadDat (void)
{
FILE *fp;
int i=0;
if((fp=fopen("IN70.DAT","r"))==NULL) return 1;
while (!feof (fp) )
{
fscanf (fp, "%d", &xx [ i++ ] );
}
fclose (fp);
return 0;
}
void WriteDat (void)
{
FILE *fp;
fp=fopen("OUT70.DAT", "w");
fprintf (fp, "%d\n%d\n%. 21f\n", totNum, totCnt, totPj z);
fclose (fp);
}
第10题
已知在文件in70.dat中存有若干个(个数<200)4位数字的正整数,函数ReadDat()是读取这若干个正整数并存入数组xx中。请编制函数CalValue(),其功能要求是:(1)求出这个文件中共有多少个正整数totNum。 (2)求这些数右移一位后,产生的新数是奇数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz。最后调用函数WriteDat()把所有结果输出到文件out70.dat中。
注意:部分源程序己给出。
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
试题程序:
include<stdio. h>
include<conio. h>
define MAXNUM 200
iht xx [MAXNUM];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat (void);
void WriteDat(void);
void CalValue(void)
{
}
void main()
{
int i;
clrscr ();
for (i=0; i xx[i]=0;
if (ReadDat ())
{
printf ("数据文件IN70.DAT不能打开! \007\n");
return;
}
CalValue ();
printf ("文件IN70. DAT中共有正整数=%d个\n", totNum);
printf ("符合条件的正整数的个数=%d个\n", totCnt);
printf ("平均值=%. 21f\n", totPj z);
WriteDat ();
int ReadDat (void)
{
FILE *fp;
iht i=0;
if ((fp=fopen ("IN70 .DAT", "r") )==NULL) return 1;
while (! feof (fp))
{
fscanf (fp, "%d", &xx [i++] );
}
fclose (fp);
return 0;
}
void WriteDat(void)
{
FILE *fp;
fp=fopen ("OUT70. DAT", "w");
fprintf (fp, "%d\n%d\n%. 21f\n",totNum, totCnt, totPjz);
fclose (fp);
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!