hoj2080夹角有多大II
2012-09-25 21:12
162 查看
//C++我CE了半天啊……苦逼啊
#include<stdio.h> #include<math.h> #define pi acos(-1) typedef struct p{ double x,y; }p; double distant(p a,p b){ return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); } int main(){ int t; p a,b,c; double q,w,e,s; c.x=0.0;c.y=0.0; scanf("%d",&t); while(t--){ scanf("%lf%lf",&a.x,&a.y); scanf("%lf%lf",&b.x,&b.y); if(b.y/b.x==a.y/a.x){ if((b.y>0.0&&a.y<0.0)||(b.y<0.0&&a.y>0.0)) printf("180.00\n"); else printf("0.00\n"); } else{ q=distant(a,c); w=distant(b,c); e=distant(a,b); s=(double)(q+w-e)/(2.0*sqrt(1.0*q*w)); s=acos(s); s=s*180/pi; printf("%.2lf\n",s); } } return 0; }
相关文章推荐
- HDU 2080 夹角有多大II
- hdoj 2080 夹角有多大II
- 杭电 2080 夹角有多大II
- hdu 2080 夹角有多大II (数学)
- hdu---2080夹角有多大II
- HDU_2080 夹角有多大II
- 夹角有多大II
- HDU 2080 夹角有多大II(余弦公式)
- HDU2080 夹角有多大II
- 夹角有多大II
- 2080夹角有多大II
- HDOJ 2080 夹角有多大II
- hdoj.2080 夹角有多大II 20140808
- 【杭电oj】2080 - 夹角有多大II(向量夹角,反三角函数)
- 夹角有多大II
- 杭电ACM2080--夹角有多大II
- hdu 2080 夹角有多大II
- 夹角有多大II
- hdu 2080 夹角有多大II
- HDU 2080 夹角有多大II