
求高手帮忙fortran中的错误:An ENDIF occurred without a corresponding IF THEN or ELSE statement
doii=1,80dojj=1,80if(((y.ge.((jj-1)*1000-20000)).and.(y.lt.(jj*1000-20000)).and.&((x....
do ii=1,80
do jj=1,80
if (((y.ge.((jj-1)*1000-20000)).and.(y.lt.(jj*1000-20000)).and.
& ((x.ge.((ii-1)*1000-20000)).and.(x.lt.(ii*1000-20000))) then
aa(ii,jj)=aa(ii,jj)+1
goto 1
end if
end do
1 end do
错误: Error: Syntax error, found IDENTIFIER 'THEN' when expecting one of: * :: , <END-OF-STATEMENT> ; : ) + . - (/ [ ] /) ** / > // .LT. < ...
& ((x.ge.((ii-1)*1000-20000)).and.(x.lt.(ii*1000-20000))) then
Error: An ENDIF occurred without a corresponding IF THEN or ELSE statement.
end if 展开
do jj=1,80
if (((y.ge.((jj-1)*1000-20000)).and.(y.lt.(jj*1000-20000)).and.
& ((x.ge.((ii-1)*1000-20000)).and.(x.lt.(ii*1000-20000))) then
aa(ii,jj)=aa(ii,jj)+1
goto 1
end if
end do
1 end do
错误: Error: Syntax error, found IDENTIFIER 'THEN' when expecting one of: * :: , <END-OF-STATEMENT> ; : ) + . - (/ [ ] /) ** / > // .LT. < ...
& ((x.ge.((ii-1)*1000-20000)).and.(x.lt.(ii*1000-20000))) then
Error: An ENDIF occurred without a corresponding IF THEN or ELSE statement.
end if 展开
1个回答
展开全部
主要是括号不匹配 少了两个右括号 导致 IF语句判断出现问题
你试试下面的代码
do ii=1,80
do jj=1,80
if (((y.ge.((jj-1)*1000-20000)).and.(y.lt.(jj*1000-20000))).and.((x.ge.((ii-1)*1000-20000)).and.(x.lt.(ii*1000-20000)))) then
aa(ii,jj)=aa(ii,jj)+1
goto 1
end if
end do
1 end do
你试试下面的代码
do ii=1,80
do jj=1,80
if (((y.ge.((jj-1)*1000-20000)).and.(y.lt.(jj*1000-20000))).and.((x.ge.((ii-1)*1000-20000)).and.(x.lt.(ii*1000-20000)))) then
aa(ii,jj)=aa(ii,jj)+1
goto 1
end if
end do
1 end do
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询