标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 22698 Accepted Submission(s):
11741
#include<stdio.h> int main() { int n,m,j,i,s; double sum; double a[110],b[110]; while(scanf("%d",&n),n) { for(i=0;i<n;i++) { scanf("%lf%lf",&a[i],&b[i]); } a[n]=a[0];b[n]=b[0]; sum=0; for(i=1;i<=n;i++) sum+=a[i-1]*b[i]-a[i]*b[i-1]; printf("%.1lf\n",sum/2); } return 0; }
标签:
原文地址:http://www.cnblogs.com/tonghao/p/4627713.html