发布网友 发布时间:2022-05-04 17:50
共1个回答
热心网友 时间:2022-06-24 11:46
dimension x(1000),y(1000)
real sum
integer i,j,k,n,stat1
open(8,file='mul_area.in',status='old')
n=0
90 n=n+1
read(8,*,iostat=stat1) x(n),y(n)
if (stat1.ne.0) goto 900
goto 90
900 n=n-1
sum=0
do 10 i=1,n-1
sum=sum+0.5*(y(i)+y(i+1))*(x(i+1)-x(i))
10continue
sum=sum+0.5*(y(n)+y(1))*(x(1)-x(n))
sum=abs(sum)
write(*,*)sum
stop
end