⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex0508.f90

📁 Fortran 95程序设计&Code-彭国伦
💻 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 + -