时间:2015-12-17 关注公众号 来源:网络
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
编译、运行、结果如下:
上一篇:codeblocks环境下fortran隐蔽性错误的解决方法
下一篇:codeblocks 环境下fortran编程实现最大值的方法
文章内容来源于网络,不代表本站立场,若侵犯到您的权益,可联系我们删除。(本站为非盈利性质网站)
电话:13918309914
QQ:1967830372
邮箱:rjfawu@163.com