求多边形面积公式(已经知道顶点坐标)
int t;
cin>>t;
while(t--) {
int n;
cin>>n;
for(int i=1;i<=n;i++){
double x,y,x0,y0,sum = 0.0;
cin >> x >> y;
x0 = x;
y0 = y;
while (--n) {
double xtmp,ytmp;
cin >> xtmp >> ytmp;
sum += (x*ytmp-y*xtmp);
x = xtmp;
y = ytmp;
}
sum += (x*y0-y*x0);
printf("%.lf\n",floor(fabs(sum/2)));
}
}