fortran程序出错

programcalculatereal::x,y,fwrite(*,*)'Pleaseencounterxandy'read(*,*)x,ywrite(*,*)'xan... program calculate
real::x,y,f
write (*,*) 'Please encounter x and y'
read (*,*) x,y
write (*,*) 'x and y are:', x,y
if (x>=0.) and (y>=0.) then
f=x+y
else if (x>=0.) and (y<0.) then
f=x+y**2
else if (x<0.) and (y>=0.) then
f=x**2+y
else
f=x**2+y**2
end if
write (*,*) 'f=', f
end

出错提示
错误 1 error #5082: Syntax error, found IDENTIFIER 'THEN' when expecting one of: ( % [ . = => C:\Projects\project1\project1\Source1.f90 6
错误 2 error #5082: Syntax error, found IDENTIFIER 'AND' when expecting one of: THEN C:\Projects\project1\project1\Source1.f90 8
错误 3 error #5082: Syntax error, found IDENTIFIER 'AND' when expecting one of: THEN C:\Projects\project1\project1\Source1.f90 10
警告 4 warning #7532: The number of arguments is incompatible with intrinsic procedure, assume 'external'. [AND] C:\Projects\project1\project1\Source1.f90 6
错误 5 error #6410: This name has not been declared as an array or a function. [AND] C:\Projects\project1\project1\Source1.f90 6
错误 6 error #6305: An ELSE statement occurred without a corresponding IF THEN statement. C:\Projects\project1\project1\Source1.f90 12
错误 7 error #6317: An ENDIF occurred without a corresponding IF THEN or ELSE statement. C:\Projects\project1\project1\Source1.f90 14
错误 8 Compilation Aborted (code 1) C:\Projects\project1\project1\Source1.f90 1
展开
 我来答
把盏饮寂寞
2013-09-06 · TA获得超过405个赞
知道小有建树答主
回答量:166
采纳率:0%
帮助的人:93万
展开全部
  1. fortran逻辑表达式中,and两边必须各有一个英文句点;

  2. 长表达式最好用括号括起来,调试程序或再读程序的时候,方便,一目了然

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
微测检测5.10
2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇... 点击进入详情页
本回答由微测检测5.10提供
sjzwuww
2013-09-06 · TA获得超过1.2万个赞
知道大有可为答主
回答量:6839
采纳率:82%
帮助的人:2523万
展开全部
if (x>=0.) and (y>=0.) then
应该为:
if (x>=0. .and. y>=0.) then
其它类似语句依此改正即可。
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式