Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program test1
- implicit none
- real:: maximum, step
- integer:: i, n
- real :: Q, f
- real, external :: hamso
- Print *,"gia tri toi da cua truc x ?"
- read *,maximum
- Print *, "buoc nhay? "
- read *,step
- n = (maximum/step) -1
- Do i=1, n
- If (Q == 1.0) then
- goto 10
- end if
- f = hamso(Q)
- Open (1, file = 'point.doc')
- write (1) Q, f
- Print *, "ngang = ",Q, "Tung = ", f
- 10 Q = Q + step
- enddo
- read *, maximum
- End program test1
- Function hamso(Q)
- implicit none
- real, intent(in):: Q
- real:: hamso
- hamso = (1.0/2.0) * sqrt((1.0-2.0*Q+ Q*Q)/(1.0-2.0*Q+2.0*Q * 0.8+Q*Q)) +1.0/2.0
- end function hamso
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement