qcode
  • 创作工场专业版,一问多答!更智能、更完整、更原创
  • 这是一个超强内容创作平台,它会写文章、做设计、绘图、敲代码,有问必答!
🔥点击使用-免登录深度版🔥

请写一个method of continued fractions 的fortran 程序计算 电子原子散射

时间2023-05-04 05:38:16 提问来自 山东省滨州市 的网友 分类创作 浏览289
program ContinuedFractions implicit none integer :: i,n real :: x,y,a(100) ! input the scattering angle and the number of terms in the series write(*,'("Input scattering angle (in radians):")') read(*,*) x write(*,'("Input number of terms:")') read(*,*) n ! compute the continued fraction for the scattering angle a(1) = x do i=2,n-1 if (i .eq. 2) then y = 0.5*x**2/a(1) ! initial value for y elseif (modulo(i-2,4).eq.0 .or. modulo(i-2,4).eq.3 ) then ! even/odd values for y y = 1./y ! compute next value of y using previous one endif a(i) = 0.5*x**2/y enddo a(n)=x/y ! print out the results do i=1,n write(*,'("a",I3,"=",F10.6)') i,a(i) enddoend program ContinuedFractions

不满意?免费深度重写!

免责声明:
以上内容除特别注明外均来源于网友提问,创作工场回答,未经许可,严谨转载。

上一篇 method of continued fractions fortran 程序 电子原子散射 下一篇 坐在火车上能写一首七言绝句吗