Subroutine Wii_()
Implicit none
real*8::x(11),y(11),pi=3.141592653589793,L
Integer::N,i,j
L=1
N=11
Do i=1,N,1
x(i)=(L/2)*(1-cos(((i-1)/(N-1))*pi))
Do j=1,N,1
y(j)=(L/2)*(1-cos(((j-1)/(N-1))*pi))
END Do
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_()
G(k)=product(x(i)-y(j),y(j)/=x(i))
W(k)=1/G(k)
write(*,*)"W(k)=W(k)"
end program main_mik
微信截图_20231215094920.png (35.11 KB, 下载次数: 68)
这是问题
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
li913 发表于 2023-12-15 11:20
product(x(i)-y,y/=x(i))
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |