Guest User

Untitled

a guest
Jan 2nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Program String_Triming
  2.  
  3. Implicit none
  4.  
  5. Open(15, File = 'Output.txt')
  6.  
  7. Write(15,'(A,1x,"j",1x,A)') Ispis(20.45),Ispis(20.45)
  8. Write(15,'(A,1x,"j",1x,A)') Ispis(-20.45),Ispis(-20.45)
  9.  
  10. Close(15)
  11.  
  12. Contains
  13.  
  14. Function Ispis ( Deg ) result ( Str )
  15.  
  16. Real,intent(in)::Deg
  17. Character(len=16):: Str
  18.  
  19. If ( Deg > 0 ) then
  20.  
  21. Write(Str,'(F0.3)') 1000.0 + Deg
  22. Str = Str(2:)
  23.  
  24. Else
  25.  
  26. Write(Str,'(F8.3)') 1000.0 + abs(Deg)
  27. Write(Str,'("-",A)') Str(3:)
  28.  
  29. End If
  30.  
  31. End Function Ispis
  32.  
  33. End program String_Triming
  34.  
  35. 020.450 j 020.450
  36. -20.450 j -20.450
  37.  
  38. 020.450 j 020.450
  39. -20.450 j -20.450
Add Comment
Please, Sign In to add comment