码迷,mamicode.com
首页 > 其他好文 > 详细

杭电2080

时间:2016-11-21 19:17:27      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:printf   mat   double   blog   函数   define   stdio.h   pre   log   

 1 //余玄定理+反三角函数
 2 #include<stdio.h>
 3 #include<math.h>
 4 #define pi  3.14159265
 5 int main()
 6 {
 7     int n;
 8     double x1,x2,y1,y2,a,b,c,ans;
 9     while(~scanf("%d",&n))
10     {
11         while(n--)
12         {
13             scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
14             a=sqrt(x1*x1+y1*y1);
15             b=sqrt(x2*x2+y2*y2);
16             c=sqrt((y2-y1)*(y2-y1)+(x2-x1)*(x2-x1));
17             ans=acos((a*a+b*b-c*c)/(2*a*b))*180/pi;
18             printf("%.2lf\n",ans);
19         }
20     }
21 }

 

杭电2080

标签:printf   mat   double   blog   函数   define   stdio.h   pre   log   

原文地址:http://www.cnblogs.com/qq188380780/p/6086023.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!