3 0 0 1 0 0 1 4 1 0 0 1 -1 0 0 -1 0
0.5 2.0解题思路:线性代数知识,矩阵乘积附图:源代码:#include <stdio.h> #include <math.h> #include <stdlib.h> int main() { int n,i,x[105],y[105]; double S; while(scanf("%d",&n) && n) { for(i=0;i<n;i++) scanf("%d%d",&x[i],&y[i]); S=0.0; for(i=0;i<n-1;i++) { S+=fabs(x[i]*y[i+1]-y[i]*x[i+1])*0.5; } S+=fabs(x[0]*y[n-1]-x[n-1]*y[0])*0.5; printf("%.1lf\n",S); } system("pause"); return 0; }
原文地址:http://blog.csdn.net/zchlww/article/details/41577599