fortran编程中的问题,我是菜鸟,盼大虾,感激PROGRAM TEST11IMPLICIT NONEREAL::ArrayREAL(8),PARAMETER::PI=3.141592654INTEGER::n,jPRINT *,'Input the value of n:'READ (*,*) nDO j=1,nArray=j/n*2*PI PRINT*,'SIN(Array)=',SIN(Array),'COS(Array)=',
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 13:54:25
fortran编程中的问题,我是菜鸟,盼大虾,感激PROGRAM TEST11IMPLICIT NONEREAL::ArrayREAL(8),PARAMETER::PI=3.141592654INTEGER::n,jPRINT *,'Input the value of n:'READ (*,*) nDO j=1,nArray=j/n*2*PI PRINT*,'SIN(Array)=',SIN(Array),'COS(Array)=',
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呢,哪出错了,
fortran编程中的问题,我是菜鸟,盼大虾,感激PROGRAM TEST11IMPLICIT NONEREAL::ArrayREAL(8),PARAMETER::PI=3.141592654INTEGER::n,jPRINT *,'Input the value of n:'READ (*,*) nDO j=1,nArray=j/n*2*PI PRINT*,'SIN(Array)=',SIN(Array),'COS(Array)=',
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
我帮你改完了,你试试吧.
有什么问题可以再问我