[Fortran] 纯文本查看 复制代码 Subroutine Wii_(x,y)
Implicit none
real*8::x(11),y(11),pi=acos(-1.0),L
Integer::N,i,j
L=1
N=11
Do i=1,N
x(i)=(L/2)*(1-cos(((i-1.0)/(N-1.0))*pi))
END Do
Do j=1,N
y(j)=(L/2)*(1-sin(((j-1.0)/(N-1.0))*pi))
END Do
end Subroutine Wii_
program main_mik
Implicit real*8(a-z)
real*8::G(1),W(1),x(11),y(11)
Integer::k
k=1
call Wii_(x,y)
G(k)=product(x-y,x/=y)
W(k)=1/G(k)
write(*,*)"W(k)=",W(k)
end program main_mik |