windows平台下fortran编程实现求最小值

2026-02-14 10:06:15

1、关于codeblocks IDE的极速安装

请参考百度经验<<Windows下极速搭建fortran开发环境>>

windows平台下fortran编程实现求最小值

2、fortran编程实现求最小值

源代码如下:

    implicit none

    integer::i,j,N

    real*8::x(8)

    real*8::tmp

    x=[12,39,499,20,3,1999,888,8]

    N=size(x)

    tmp=x(1)

    do i=1,N

        if(x(i)<tmp)then

            tmp=x(i)

        end if

    end do

    print *, "最小值为:",tmp

windows平台下fortran编程实现求最小值

3、编译、运行、结果如下:

windows平台下fortran编程实现求最小值

猜你喜欢