Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:谁能告诉我,为什么WA?

Posted by caogtaa at 2007-09-24 10:11:55 on Problem 3355
In Reply To:谁能告诉我,为什么WA? Posted by:kikif at 2007-09-03 11:31:15
int cmp(const void *a1,const void *a2){
	point p1=*(point *)a1;point p2=*(point *)a2;
	double tmp=xmult(p1,p2,p[0]);
	if(tmp==0){
		return (p2.x*p2.x+p2.y*p2.y-p1.x*p1.x-p1.y*p1.y);
	}
	return tmp;  //
}

cmp函数返回int类型,而叉积函数返回double类型,强制转换会出现问题。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator