program main
implicit none
character*10,external::num2str ! add in program main
integer,external::str2num !add in program main
integer::num
character*10::str
num=100
str="100"
print*,num2str(num)
print*,str2num(str)
end program main
!---function num2str and str2num----------------
function num2str(num)
implicit none
integer::num
character*10::num2str
!
write(num2str,"(I0)")num
!
return
end function num2str
function str2num(str)
implicit none
character*10::str
integer::str2num
!
read(str,*)str2num
!
return
end function str2num
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire