Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
晕死……大家来看看这会不会是编译器的问题~晕死 这段代码我在浙大上面怎么交都是WA 但到PKU来一下就过了……这造成本人主观上十分鄙视ZJU的Online judge 可能是编译器的不同……大家看看可能是哪里的问题……以后可以注意一下 ~~~ #include <stdio.h> typedef struct point { int x,y; }POINT,*POINT_PTR; POINT p[3]; int N,n,i; double area,xx,yy,temp; int main(void) { scanf("%d",&N); while(N--) { area=xx=yy=0.0; scanf("%d",&n); scanf("%d %d %d %d",&p[0].x,&p[0].y,&p[2].x,&p[2].y); --n; while(--n) { p[1].x=p[2].x; p[1].y=p[2].y; scanf("%d %d",&p[2].x,&p[2].y); temp=p[1].x*p[0].y-p[0].x*p[1].y+p[2].x*p[1].y-p[1].x*p[2].y+p[0].x*p[2].y-p[2].x*p[0].y; area+=temp; xx+=(p[0].x+p[1].x+p[2].x)*temp; yy+=(p[0].y+p[1].y+p[2].y)*temp; } printf("%.2lf %.2lf\n",xx/area/3.0,yy/area/3.0); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator