#author("2016-08-25T15:01:07+09:00","default:Miyashita","Miyashita")
#author("2018-07-26T00:01:26+09:00","default:Miyashita","Miyashita")
*数値⇔文字列の変換 [#bb94bb17]
character型のstr,integer型のnumとすると,
-数値→文字列
 write(str,'(I5)') num
#codeprettify(lang-fortran){{
write(str,'(I5)') num
}}
-文字列→数値
 read(str,'(I5)') num
#codeprettify(lang-fortran){{
read(str,'(I5)') num
}}
となる.formatの部分は型に応じてf8.0とか適当に.~
fortranは数値⇔文字列の変換がまわりくどいような気がする.~

Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes