fortran中简单的选择结构问题

青城山下游 2019-11-15 01:21:29
老是出现各种错误,我已经不知道怎么改了,也查了好久百度,求解惑。 代码如下 program main
implicit none
real::x,y
read*,x
if(x.GT.-15.and.x.LT.0) then y=COS(x)
else
if(x.GE.0.and.x.IT.10) then y=LOG(x**2+1)
else
if(x.GT.15.and.x.IT.20) then y=x**(1/3)
else print*,'其他'
END IF
print*,'y=',y
end
...全文
18 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
青城山下游 2019-11-15
  • 打赏
  • 举报
回复
program main
implicit none
real::x,y
read*,x
if(x.GT.-15.and.x.LT.0) then y=COS(x)
else
if(x.GE.0.and.x.LT.10) then y=LOG(x**2+1)
else
if(x.GT.15.and.x.LT.20) then y=x**(1/3)
else print*,'其他'
END IF
print*,'y=',y
end 其中有两个字母输错了,但除此之外还是有错误

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧