1:变量声明
类型 :: 名称
program variableTesting
implicit none
!declaring variableas
integer :: total
real :: average
complex :: cx
logical :: done
character (len = 80) :: message
!assigning values
total = 20000
average = 1666.67
done = .true.
message = "Hello Oliva coding Fortran"
cx = (3.0,5.0) !cx = 3.0+5.0i
print *,total
print *,average
print *,cx
print *,done
print *,message
read*
end program variableTesting
结果:

网友评论