夹角有多大II
来源:互联网 发布:英国做律师 知乎 编辑:程序博客网 时间:2024/04/27 16:40
夹角有多大II
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11539 Accepted Submission(s): 5983
Problem Description
这次xhd面临的问题是这样的:在一个平面内有两个点,求两个点分别和原点的连线的夹角的大小。
注:夹角的范围[0,180],两个点不会在圆心出现。
注:夹角的范围[0,180],两个点不会在圆心出现。
Input
输入数据的第一行是一个数据T,表示有T组数据。
每组数据有四个实数x1,y1,x2,y2分别表示两个点的坐标,这些实数的范围是[-10000,10000]。
每组数据有四个实数x1,y1,x2,y2分别表示两个点的坐标,这些实数的范围是[-10000,10000]。
Output
对于每组输入数据,输出夹角的大小精确到小数点后两位。
Sample Input
21 1 2 21 1 1 0
Sample Output
0.0045.00
Author
xhd
Source
ACM程序设计期末考试_热身赛(感谢 xhd & 8600)
Recommend
lcy | We have carefully selected several similar problems for you: 2076 2079 2082 2093 2077
#include<iostream>#include<cstdlib>#include<cstdio>#include<cmath>#include<cstring>#include<string>#include<cstdlib>#include <set>#include<algorithm>#include <limits.h>#include <ctype.h>#include <map>#include <stack>#include <sstream>typedef long long LL;using namespace std;const int N = 105;int data[N][N];int dp[N][N];char c[100][100] = {' '};#define PI 3.1415926int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int T; cin >> T; double x1, y1, x2, y2; while(T--){ //if(n == 0 && m== 0) break; scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2); double a = sqrt(x1 * x1 + y1 * y1); double b = sqrt(x2 * x2 + y2 * y2); double c = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); double cos = (a * a + b * b - c * c) / (2 * a * b); double res = acos(cos) * 180 / PI; if(res > 180){ res -= 180; } printf("%.2lf\n", res); } return 0;}
0 0
- 夹角有多大II
- 夹角有多大II
- 夹角有多大II
- 夹角有多大II
- 夹角有多大II
- hoj2080夹角有多大II
- hdu2080(夹角有多大II)
- hdu2080夹角有多大II
- HDU2080:夹角有多大II
- HDU夹角有多大II
- 2080 夹角有多大II
- HDU_2080 夹角有多大II
- 2080夹角有多大II
- HDU2080 夹角有多大II
- HDU2080 夹角有多大II
- 夹角有多大II hdu2080
- HDU2080夹角有多大II
- HDU2080 夹角有多大II
- HDOJ 1522 Marriage is Stable
- input传参
- 【ONION勒索软件】Win10系统防护ONION勒索病毒的详细步骤
- 【技术美术】盘点十大可捏脸的单机游戏
- 点滴学习Linux----echo 命令学习
- 夹角有多大II
- android与H5的交互
- Spring_MVC传递参数乱码
- Spring Security 参考手册(一)
- Linux进程状态
- 配置s2sh框架
- SQLAlchemy复合主键
- Picture
- 【hihocoder】KMP子串数目匹配