windows平台下fortran编程实现最大值
1、关于codeblocks IDE的极速安装
请参考百度经验<<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
3、编译、运行,结果如下:
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:117
阅读量:175
阅读量:90
阅读量:64
阅读量:39