gpt4 book ai didi

FORTRAN 77 "Error: Unclassifiable statement at (1)"

转载 作者:行者123 更新时间:2023-12-04 04:33:43 26 4
gpt4 key购买 nike

这个程序:

C This program calculates cos(x**2)

PROGRAM COSX_SQUARE
IMPLICIT NONE
INTEGER a
REAL y, r

PRINT*, 'INPUT THE DEGREE'
PRINT*, 'BETWEEN 0 AND 360'
READ*, a

a*(3.141592/180) = y

C This part determines minus sign and calculates the function

IF (a .GT. 90) THEN
r = -(1-(y**4)/2+(y**8)/24-(y**12)/720+(y**16)/40320)
ELSEIF (a .GE. 270) THEN
r = 1-(y**4)/2+(y**8)/24-(y**12)/720+(y**16)/40320
ELSEIF (a .GT. 360) THEN
PRINT*, 'INVALID DEGREE'
PRINT*, 'DEGREE MUST BE BETWEEN 0 AND 360'
ELSEIF (a .LT. 0) THEN
PRINT*, 'INVALID DEGREE'
PRINT*, 'DEGREE MUST BE BETWEEN 0 AND 360'
END IF

PRINT*, 'THE RESULT OF COS', a, 'SQUARE IS = ', r

STOP
END

给出这个错误:
    a*(3.141592/180)=y                                
1
Error: Unclassifiable statement at (1)

我已经定义了 a作为整数。为什么这个错误不断出现?

最佳答案

是的。它是一个开始语句的表达式。也许把它改成

  y = a*(3.141592/180)

如果那是你真正的意思。

关于FORTRAN 77 "Error: Unclassifiable statement at (1)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20104686/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com