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

VC上一点问题都没有,可在这里怎么出现编译错误了,大家能告诉我为什么吗

Posted by fanxiaochen at 2010-08-09 23:59:03 on Problem 1254
#include<stdio.h>
#include<math.h>
#define P 3.1415927
typedef struct
{
	double x;
	double y;
	double d;
}POINT;

POINT  common_point(POINT A,POINT B)
{
	POINT C;
	POINT T;
	
	A.d=90-A.d;
	B.d=90-B.d;
	

	if(A.d!=90&&B.d!=90)
	{
		C.x=((A.y-B.y)-(tan(A.d*P/180)*A.x-tan(B.d*P/180)*B.x))/(tan(B.d*P/180)-tan(A.d*P/180));
		C.y=tan(A.d*P/180)*(C.x-A.x)+A.y;
	}

	else
	{
		if(A.d==90)
		{
			T=A;
			A=B;
			B=T;
			
		}

		if(B.d==90)
		{
			C.x=B.x;
			C.y=tan(A.d*P/180)*(C.x-A.x)+A.y;
		}
	}

		return C;
}


void main()
{
	int t;
	int i,j;
	POINT A,B,C[100];
	scanf("%d",&t);
	for(i=0;i<t;i++)
	{
		scanf("%lf %lf %lf",&A.x,&A.y,&A.d);
		scanf("%lf %lf %lf",&B.x,&B.y,&B.d);
		C[i]=common_point(A,B);
	}

	for(j=0;j<i;j++)
		printf("%.4lf %.4lf\n",C[j].x,C[j].y);
}

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