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

📄 ex0505.f90

📁 Fortran 95程序设计【彭国伦】第5章原代码
💻 F90
字号:
program ex0505
implicit none
  integer score
  character grade
	
  write(*,*) "Score:"
  read(*,*)  score

  if ( score>=90 .and. score<=100 ) then
    grade='A'
  else if ( score>=80 .and. score<90 ) then
    grade='B'
  else if ( score>=70 .and. score<80 ) then
    grade='C'
  else if ( score>=60 .and. score<70 ) then
    grade='D'
  else if ( score>=0 .and. score<60 ) then
    grade='E'
  else 
    ! score<0 或 score>100的不合理情形
    grade='?'
  end if

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

stop
end

⌨️ 快捷键说明

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