标签:blog define 关系 小数 color tac sam under queue
1 #include<map> 2 #include<set> 3 #include<list> 4 #include<deque> 5 #include<cmath> 6 #include<queue> 7 #include<stack> 8 #include<vector> 9 #include<cstdio> 10 #include<complex> 11 #include<cstring> 12 #include<cstdlib> 13 #include<iostream> 14 #include<algorithm> 15 #define LL long long 16 #define db double 17 #define RG register 18 #define maxx 110 19 using namespace std; 20 struct point{ 21 LL x,y; 22 point() {} 23 point(LL _x,LL _y):x(_x),y(_y) {} 24 LL operator ^ (const point a) const{ 25 return x*a.y-y*a.x; 26 } 27 }a[maxx]; 28 int n; 29 int main(){ 30 while(scanf("%d",&n)&&n){LL x,y; 31 scanf("%lld%lld",&x,&y);LL xx,yy; 32 for(int i=2;i<=n;++i)scanf("%lld%lld",&xx,&yy),a[i]=point(xx-x,yy-y); 33 db sz=0; 34 for(int i=2;i<n;++i)sz+=a[i]^a[i+1]; 35 printf("%.1lf\n",sz/2); 36 } 37 return 0; 38 }
标签:blog define 关系 小数 color tac sam under queue
原文地址:http://www.cnblogs.com/zzmmm/p/6949596.html