FORTRAN问题,二处错误ROGRAM MAIN\x05PROGRAM EX2 \x05PRINT *,'R=',1.0,'C=',C(1,0)\x05PRINT *,'R=',3.0,'C=',C(3,0)\x05PRINT *,'R=',4.0,'C=',C(4,0)\x05PRINT *,'R=',12.0,'C=',C(12,0)\x05ENDPROGRAM 1\x05FUNCTION C(R)\x05PI=3.1415926\x05C=2*PI*R\x05RE

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/21 11:26:51
FORTRAN问题,二处错误ROGRAMMAIN\x05PROGRAMEX2\x05PRINT*,''R='',1.0,''C='',C(1,0)\x05PRINT*,''R='',3.0,''C='',C(3,0)

FORTRAN问题,二处错误ROGRAM MAIN\x05PROGRAM EX2 \x05PRINT *,'R=',1.0,'C=',C(1,0)\x05PRINT *,'R=',3.0,'C=',C(3,0)\x05PRINT *,'R=',4.0,'C=',C(4,0)\x05PRINT *,'R=',12.0,'C=',C(12,0)\x05ENDPROGRAM 1\x05FUNCTION C(R)\x05PI=3.1415926\x05C=2*PI*R\x05RE
FORTRAN问题,二处错误
ROGRAM MAIN
\x05PROGRAM EX2
\x05PRINT *,'R=',1.0,'C=',C(1,0)
\x05PRINT *,'R=',3.0,'C=',C(3,0)
\x05PRINT *,'R=',4.0,'C=',C(4,0)
\x05PRINT *,'R=',12.0,'C=',C(12,0)
\x05END
PROGRAM 1
\x05FUNCTION C(R)
\x05PI=3.1415926
\x05C=2*PI*R
\x05RETURN
\x05END
D:\xuexi\Fortran\2\EX2.F90(2) :Error:This statement is positioned incorrectly and/or has syntax errors.
PROGRAM EX2
D:\xuexi\Fortran\2\EX2.F90(9) :Error:Syntax error,found INTEGER_CONSTANT '1' when expecting one of:
PROGRAM 1

FORTRAN问题,二处错误ROGRAM MAIN\x05PROGRAM EX2 \x05PRINT *,'R=',1.0,'C=',C(1,0)\x05PRINT *,'R=',3.0,'C=',C(3,0)\x05PRINT *,'R=',4.0,'C=',C(4,0)\x05PRINT *,'R=',12.0,'C=',C(12,0)\x05ENDPROGRAM 1\x05FUNCTION C(R)\x05PI=3.1415926\x05C=2*PI*R\x05RE
楼主,帮你改了一下,复制我改的程序运行吧,程序如下:
PROGRAM EX2
REAL R,C
PRINT *,'R=',1.0,'C=',C(1.0)
PRINT *,'R=',3.0,'C=',C(3.0)
PRINT *,'R=',4.0,'C=',C(4.0)
PRINT *,'R=',12.0,'C=',C(12.0)
END
FUNCTION C(R)
REAL R,C
PI=3.1415926
C=2*PI*R
RETURN
END