📄 ex0508.f90
字号:
program ex0508
implicit none
real x,y
integer ans
write(*,*) "Input (x,y)"
read(*,*) x,y
if ( x>0 ) then
if ( y>0 ) then ! x>0,y>0
ans=1
else if ( y<0 ) then ! x>0, y<0
ans=4
else ! x>0, y=0
ans=0
end if
else if ( x<0 ) then
if ( y>0 ) then ! x<0, y>0
ans=2
else if ( y<0 ) then ! x<0, y<0
ans=3
else ! x<0, y=0
ans=0
end if
else ! x=0, y=任意数
ans=0
end if
if ( ans/=0 ) then ! ans不为0时, 代表有解
write(*,"('第',I1,'象限')") ans
else
write(*,*) "落在轴上"
end if
stop
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -