ans0503.f90

来自「这是fortran95第五章的课后答案」· F90 代码 · 共 31 行

F90
31
字号
program main
  implicit none
  integer age, money
  real tax

  write(*,*) "请输入年龄"
  read(*,*) age
  write(*,*) "请输入月收入"
  read(*,*) money

  if ( age<50 ) then
    if ( money<1000 ) then
	  tax = 0.03
	else if ( money<5000 )then
	  tax = 0.10
	else
	  tax = 0.15
	end if
  else
    if ( money<1000 ) then
	  tax = 0.5
	else if ( money<5000 )then
	  tax = 0.7
	else
	  tax = 0.10
	end if
  end if
  
  write(*,"(' 税金为 'I8)") nint(money*tax)

end program

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?