program ex0513
implicit none
real a,b,c
character g
read(*,*)a
read(*,"(a1)")g
read(*,*)b
select case(g)
case('+')
c=a+b
case('-')
c=a-b
case('*')
c=a*b
case('/')
c=a/b
case default
write(*,*)"输入出错"
stop
end select
write(*,"(f6.2,a1,f6.2,'=',f6.2)")a,g,b,c
stop
end
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |