You Are All Excellent(余弦排比0~180)
来源:互联网 发布:电信网络维修工作总结 编辑:程序博客网 时间:2024/04/29 12:31
#include<stdio.h>#include<math.h>#include<algorithm>using namespace std;struct loaction{ double x; double y;}s[101];int cmp(loaction a,loaction b){ double c,d; c=a.x/sqrt(a.x*a.x+a.y*a.y); d=b.x/sqrt(b.x*b.x+b.y*b.y); return acos(c)<acos(d);}int main (){ int m,i; while(scanf("%d",&m)!=EOF&&m>=0) { for(i=0;i<101;i++) { s[i].x=0;s[i].y=0; } for(i=0;i<m;i++) { scanf("%lf%lf",&s[i].x,&s[i].y); } sort(s,s+m,cmp); for(i=0;i<m-1;i++) { printf("%.1lf %.1lf ",s[i].x,s[i].y); } printf("%.1lf %.1lf\n",s[m-1].x,s[m-1].y); } return 0;}
点击打开链接
0 0
- You Are All Excellent(余弦排比0~180)
- HDU1785 You Are All Excellent【余弦】【水题】
- You Are All Excellent 1785
- You Are All Excellent 排序
- hdu1785 You Are All Excellent
- HDU:You Are All Excellent
- HDOJ1785 You Are All Excellent
- HDU 1785 You Are All Excellent(数学题)
- hdu1785 You Are All Excellent (极角排序)
- hdu 1785 You Are All Excellent
- hdu 1785 You Are All Excellent
- hdu 1785 You Are All Excellent
- HDU 1785 You Are All Excellent
- HDU 1785 You Are All Excellent
- HDU 1785 You Are All Excellent
- HDOJ 1785 You Are All Excellent
- hdoj problem1785 You Are All Excellent(结构体sort排序&&三角函数)
- HDU 1785 You Are All Excellent(斜率排序+结构体)
- Sencha学习笔记1: Getting Started with Sencha Touch - 官方Sencha Touch入门指南
- windows操作系统下java程序使用sigar的使用问题
- hdu 1114 Piggy-Bank 完全背包
- 安卓开发笔记(二) Android使用AttributeSet自定义控件的方法
- 1007 正整数分组
- You Are All Excellent(余弦排比0~180)
- 收录一些xss漏洞过滤方法
- uva 10129 Play on Words(欧拉路)
- 我的2008
- 整数划分
- JavaScript关键字和保留字
- 利用三轴加速器的计步测算方法
- mysql.sock文件丢失
- 【LeetCode】Largest Number 解题报告