二级FORTRAN程序设计上机题1
来源:优易学  2011-12-9 20:37:46   【优易学:中国教育考试门户网】   资料下载   IT书店

======================================================================
试题说明 :
======================================================================
补充编制fortran77程序prog1.for,其功能是计算并输出级
数和
1 1 (-1)^n
s(n)=x - ─x^3 + ─x^5 - ... + ── x^(2n+1)
3 5 2n+1

直到s(n)-s(n-1)<0.000001为止。其中x=0.7。
请编写该程序,最后运行程序。其中部分程序与输出子程序
writedat在程序中已经给出,不得修改。
======================================================================
程序 :
======================================================================

write(*,100) s
100 format(1x,'s=',e12.4)
write(*,*)
call writedat(s)
end

subroutine writedat(s)
open(10,file='bc01.out',status='new')
write(10,100) s
100 format(1x,e12.4)
end
======================================================================
所需数据 :
======================================================================
@3 $bc01.out 001
|.6107e+00
#e

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训