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/09/08 01:18:03
![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](/uploads/image/z/11033476-52-6.jpg?t=FORTRAN%E9%97%AE%E9%A2%98%2C%E4%BA%8C%E5%A4%84%E9%94%99%E8%AF%AFROGRAM+MAIN%5Cx05PROGRAM+EX2+%5Cx05PRINT+%2A%2C%27R%3D%27%2C1.0%2C%27C%3D%27%2CC%281%2C0%29%5Cx05PRINT+%2A%2C%27R%3D%27%2C3.0%2C%27C%3D%27%2CC%283%2C0%29%5Cx05PRINT+%2A%2C%27R%3D%27%2C4.0%2C%27C%3D%27%2CC%284%2C0%29%5Cx05PRINT+%2A%2C%27R%3D%27%2C12.0%2C%27C%3D%27%2CC%2812%2C0%29%5Cx05ENDPROGRAM+1%5Cx05FUNCTION+C%28R%29%5Cx05PI%3D3.1415926%5Cx05C%3D2%2API%2AR%5Cx05RE)
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