くだすれFORTRAN(超初心者用)その4at TECH
くだすれFORTRAN(超初心者用)その4 - 暇つぶし2ch646:デフォルトの名無しさん
09/10/13 19:46:13
>>645
こんな感じ?

module mod1
 interface sub
  module procedure sub_int, sub_real
 end interface

contains
 subroutine sub_int(n)
  integer, intent(in) :: n
  print *, "INTEGER", n
 end subroutine sub_int

 subroutine sub_real(x)
  real, intent(in) :: x
  print *, "REAL", x
 end subroutine sub_real
end module mod1

! ---------------
program prog1
 use mod1
 call sub(1)
 call sub(2.0)
end program prog1




次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch