fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1不知道哪错了编译时总出错fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1)不知道哪错了编译时总出错,其我想判断数
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/30 05:43:01
![fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1不知道哪错了编译时总出错fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1)不知道哪错了编译时总出错,其我想判断数](/uploads/image/z/9305012-20-2.jpg?t=fortran%E9%80%BB%E8%BE%91%E8%A1%A8%E8%BE%BE%E5%BC%8F%28x%281%29.gt.1%29.or.%28x%282%29.gt.1%29.or.%28x%283%29.gt.1%29.or.%28x%284%29.gt.1%E4%B8%8D%E7%9F%A5%E9%81%93%E5%93%AA%E9%94%99%E4%BA%86%E7%BC%96%E8%AF%91%E6%97%B6%E6%80%BB%E5%87%BA%E9%94%99fortran%E9%80%BB%E8%BE%91%E8%A1%A8%E8%BE%BE%E5%BC%8F%28x%281%29.gt.1%29.or.%28x%282%29.gt.1%29.or.%28x%283%29.gt.1%29.or.%28x%284%29.gt.1%EF%BC%89%E4%B8%8D%E7%9F%A5%E9%81%93%E5%93%AA%E9%94%99%E4%BA%86%E7%BC%96%E8%AF%91%E6%97%B6%E6%80%BB%E5%87%BA%E9%94%99%2C%E5%85%B6%E6%88%91%E6%83%B3%E5%88%A4%E6%96%AD%E6%95%B0)
fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1不知道哪错了编译时总出错fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1)不知道哪错了编译时总出错,其我想判断数
fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1不知道哪错了编译时总出错
fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1)不知道哪错了编译时总出错,其我想判断数组x中每个元素小于1,有一个大于1则跳出
fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1不知道哪错了编译时总出错fortran逻辑表达式(x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1)不知道哪错了编译时总出错,其我想判断数
第一,你是否把最后一个括号写成了全角?
第二,以下代码我这边可以正常运行.
program main
implicit none
integer ::x(4) = (/0,0,1,2/)
if ( (x(1).gt.1).or.(x(2).gt.1).or.(x(3).gt.1).or.(x(4).gt.1) ) then
write(*,*) 's'
end if
end
第三,对于你的情况,您可以使用 any 语句.
program main
implicit none
integer ::x(4) = (/0,0,1,2/)
if ( any( x(1:4) > 1 ) ) then
write(*,*) 's'
end if
end