ex1106.f90

来自「Fortran 95程序设计【彭国伦】第11章」· F90 代码 · 共 27 行

F90
27
字号
module MA
  implicit none
  type ta
    integer a
  end type
  interface operator(+)
    module procedure add
  end interface
contains
  integer function add(a,b)
    type(ta), intent(in) :: a,b
	add=a%a+b%a
  end function
end module

program main
  use MA
  implicit none
  type(ta) :: a,b
  integer  :: c
  a%a=1
  b%a=2
  c=a+b
  write(*,*) c
end program

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?