标签:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int a[110],b[110],i,j,n;
double s;
while(scanf("%d",&n)!=EOF&&n!=0)
{
s=0;
for(i=0;i<n;i++)
{
scanf("%d%d",&a[i],&b[i]);
}
a[n]=a[0];b[n]=b[0];
for(i=0;i<n;i++)
{
s=s+(a[i]*b[i+1]-a[i+1]*b[i])*0.5;
}
printf("%.1lf\n",s);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/aisuiyuan/p/4409400.html