ex0507.f90

来自「fortran 95书的源程序全集」· F90 代码 · 共 20 行

F90
20
字号
program ex0507
implicit none
  integer score
  character grade
	
  write(*,*) "Score:"
  read(*,*)  score

  if ( score>=90 .and. score<=100 ) grade='A'
  if ( score>=80 .and. score<90 )   grade='B'
  if ( score>=70 .and. score<80 )   grade='C'
  if ( score>=60 .and. score<70 )   grade='D'
  if ( score>=0  .and. score<60 )   grade='E'
  if ( score>100 .or.  score<0  )   grade='?' 

  write(*,"('Grade:',A1)") grade

stop
end

⌨️ 快捷键说明

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