跳到主要内容

Fortran 传递参数

program main
call add(a,b)
...
stop
end program
! 传址调用:子程序更改数值导致主程序也更改
subroutine add(first, second)
integer first, second
write (*, *) first + second
return
end subroutine