【发布时间】:2015-09-15 13:01:42
【问题描述】:
我正在通过 fortran 90 运行此代码
Program Projectile
! This Program Calculates the Velocity and Height of a
! Projectile
! Given its Initial Height, Initial Velocity and Constant
! Acceleration.
Implicit None
Real :: Initial_Hight, Height, Initial_Velocity, Velocity, &
Time, Acceleration = -9.807
! Obtain Values for Initial Height, Initial Velocity and
! Time
Print*, "Enter the Initial Height and Velocity:"
Read*, Initial_Height, Initial_Velocity
Print*, "Enter Time at Which to Calculate Height and &
Velocity:"
Read*, Time
! Calculate the Height and Velocity
Height = 0.5 * Acceleration * Time ** 2 + Initial_Velocity &
* Time + Initial_Height
Velocity = Acceleration * Time + Initial_Velocity
! Display Velocity and Height
Print*, "At Time", Time, "The Vertical Velocity is", Velocity
Print*, "and the Height is", Height
End Program Projectile
但我经常收到此错误:错误符号“initial_height”没有隐式类型,在删除隐式空行后,我不能使用实数,因为实数会导致另一个错误,你能帮帮我吗?
【问题讨论】:
标签: fortran