fork download
  1. program Zadaniel_3
  2.  
  3. implicit none
  4.  
  5.  
  6. real::eps,x,res0,res,controlres
  7. integer:: i
  8.  
  9. !open(12,file="resultl_3.dat")
  10. !print*,'Vvedite x'
  11. !read*,x
  12. !print*,'Vvedite tochnost'
  13. !read*,eps
  14. x=0.53
  15. eps=0.001
  16.  
  17.  
  18.  
  19. i=2
  20. res0=1-5*x/2
  21. do
  22. res=res0+res0*2*i*(2*i+3)*(-1)**i
  23. if ((res-res0)<eps) exit
  24. !write(12,*)i,res
  25. i=i+1
  26. res0=res
  27. end do
  28.  
  29. print*,'Raschet po ryadu=',res0
  30. print*,'Raschet po formule=',SOSI_PISOS(4.012)
  31.  
  32. contains
  33.  
  34. real function SOSI_PISOS(n)
  35. implicit none
  36. real, intent(in) :: n
  37. real :: ans
  38. integer :: i
  39. ans = sqrt((1+n)**5)
  40. SOSI_PISOS=ans
  41. end function SOSI_PISOS
  42.  
  43. end program
Success #stdin #stdout 0s 14912KB
stdin
Standard input is empty
stdout
 Raschet po ryadu= -0.324999928    
 Raschet po formule=   56.2377129