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 |
VC上一点问题都没有,可在这里怎么出现编译错误了,大家能告诉我为什么吗#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator