题目内容

编写函数jsValue,它的功能是:求Hofstadter数列中的第m项H(m)(m<1000),结果由函数返回。其中数列H(n)的定义为:
H(1)=H(2)=1
H(n)=H(n-H(n-1))+H(n-H(n-2))(n>2)
最后调用函数writeDat()读取50个数据m,分别得出结果且把结果输出到文件out.dat中。
例如:当t=997时,函数值为605。
部分源程序已给出。
请勿改动主函数main()和写函数writeDat()的内容。
include<stdio. h>
int jsValue(int m)
{
main ()
{
int m;
m=300;
printf ("m=%d, k-%d\n", m, jsValue (m));
writeDat ();
writeDat ()
{
FILE *in, *out;
int i,m,s;
in= fopen ("in. dar" , "r" );
ut=f open ("out. dar" , "w" );
for (i=0; i<50; i++) {
fscanf (in, "%d", &m);
s=jsValue (m);
printf("%d\n", s );
fprintf (out, "%d\n" , s );
}
fclose (in);
fclose (out);

查看答案
更多问题

如何避免下岗职工在马路上卖菜现象?

The Internet is about to take off in China. As many as 9 million people are on line, a number that is estimated to hit 20 million by the end of 2000. It is predicted that this phenomenal growth will have great impact on our society and economy. Choose one aspect of our society or economy where you think the impact will be most strongly felt, and write an essay of about 300 words entitled THE IMPACT OF THE INTERNET ON...
In the first part of your writing you should present your thesis statment, and in the second part you should support the thesis statement with appropriate details. In the last part you should bring what you have written to a natural conclusion or a summary.
Marks will be awarded for content, organization, grammar and appropriacy. Failure to follow the above instructions may result in a loss of marks.

简答题
本大题共3小题,每小题8分。
说明教育对生产力的促进作用。

背景资料
某机电安装工程项目开工之前,承包方向监理工程师提交了施工进度计划如下图所示,该计划满足合同工期100d的要求。
在上述施工进度计划中,由于工作E和工作G共用一塔吊(塔吊原计划在开工第25d后进场投入使用),必须顺序施工,使用的先后顺序不受限制(其他工作不使用塔吊)。
在施工过程中,由于业主要求变更设计图纸,使工作B停工10d(其他工作持续时间不变),监理工程师及时向承包方发出通知,要求承包方调整进度计划,以保证该工程按合同工期完工。
承包方提出的调整方案及附加要求(以下各项费用数据均符合实际)如下:
(一)调整方案:将工作J,的持续时间压缩5d。
(二)费用补偿要求:
1.工作J,压缩5d,增加赶工费25000元;
2.塔吊闲置15d补偿:600元/d(塔吊租赁费)×15d=9000元;
3.由于工作B停工10d造成其他有关机械闲置、人员窝工等综合损失45000元。
问题:
如果在原计划中先安排工作E,后安排工作G施工,塔吊应安排在第几天(上班时刻)进场投入使用较为合理?为什么?

答案查题题库