![](/img/trans.png)
[英].f to .f90 error causing 'Unclassifiable Statement at (1)'?
[英]Fortran F90 Unclassifiable Statement (Basic)
我剛剛開始在我大學的物理課上編程,所以我對這一切都很陌生。 但是,我找不到我在這個問題上哪里出錯了:
! Purpose: Assignment #2
! Author: Rourke Sekelsky
! Date: 9/7/2015
program arith
implicit none ! Turn off implicit typing
real :: x,y ! Define variables
real, parameter :: pi = 3.14159 ! Set the parameter pi
write(*,*) "Enter x:" ! Prompt user to enter their x-value
read(*,*) x ! Read in x-value
y = (3.0*x)+(6.0*pi)((x**3+x**(7.0/2.0)))+11.0/3.0
! Determine value of function at given x-value
write(*,*) " f(x) = ",y ! Write out the function value
stop ! Stop execution of program
end program arith
編輯:我在“y =”部分收到一個無法分類的語句錯誤。 這個程序不能用 gfortran 編譯,我不確定出了什么問題。 一些幫助會很好,謝謝!
一個字符的錯別字。 您遺漏了被乘數之間的*
運算符。 y = (3.0*x)+(6.0*pi)*((x**3.0+x**(7.0/2.0)))+11.0/3.0
有效。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.