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=x(i)
end if
end do
print *, "最小值为:",tmp
编译、运行、结果如下: