fortran编程中的问题,我是菜鸟,盼大虾,感激
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/11 05:00:16
fortran编程中的问题,我是菜鸟,盼大虾,感激
PROGRAM TEST11
IMPLICIT NONE
REAL::Array
REAL(8),PARAMETER::PI=3.141592654
INTEGER::n,j
PRINT *,'Input the value of n:'
READ (*,*) n
DO j=1,n
Array=j/n*2*PI
PRINT*,'SIN(Array)=',SIN(Array),'COS(Array)=',COS(Array)
END DO
END PROGRAM TEST11该程序运行的结果是 Input the value of n:
10
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 1.7484555E-07COS(Array)= 1.000000,前面的9个数怎么都是0呢,哪出错了,
PROGRAM TEST11
IMPLICIT NONE
REAL::Array
REAL(8),PARAMETER::PI=3.141592654
INTEGER::n,j
PRINT *,'Input the value of n:'
READ (*,*) n
DO j=1,n
Array=j/n*2*PI
PRINT*,'SIN(Array)=',SIN(Array),'COS(Array)=',COS(Array)
END DO
END PROGRAM TEST11该程序运行的结果是 Input the value of n:
10
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 0.0000000E+00COS(Array)= 1.000000
SIN(Array)= 1.7484555E-07COS(Array)= 1.000000,前面的9个数怎么都是0呢,哪出错了,
PROGRAM TEST11
IMPLICIT NONE
REAL::Array
REAL(8),PARAMETER::PI=3.141592654
INTEGER::n,j
PRINT *,'Input the value of n:'
READ (*,*) n
DO j=1,n
Array=j*2.0d0*PI/(n*1.0d0)
PRINT*, 'SIN(Array)=',SIN(Array),'COS(Array)=',COS(Array)
END DO
END PROGRAM
我帮你改完了,你试试吧.
有什么问题可以再问我
IMPLICIT NONE
REAL::Array
REAL(8),PARAMETER::PI=3.141592654
INTEGER::n,j
PRINT *,'Input the value of n:'
READ (*,*) n
DO j=1,n
Array=j*2.0d0*PI/(n*1.0d0)
PRINT*, 'SIN(Array)=',SIN(Array),'COS(Array)=',COS(Array)
END DO
END PROGRAM
我帮你改完了,你试试吧.
有什么问题可以再问我