夜空中最亮的星

夜空中最亮的星 我几何好弱啊

#include
#include
#include
#include
using namespace std;
#define PI 3.14159265358
struct node{
	double x,y,val;
}star[1002];
//priority_queue q;

double LineAngle(double x1,double y1,double x2,double y2){//向量法求夹角
	double t=(x1*x2+y1*y2)/(sqrt(x1*x1+y1*y1)*sqrt(x2*x2+y2*y2));
	double ret = acos(t);
	return ret*180/PI;
}
int cmp(node a,node b){
	return a.val>tt;
	while(tt--){
		cin>>n;
		for(int i=0;i>star[i].x>>star[i].y>>star[i].val;
		}
		cin>>x[0]>>y[0]>>x[1]>>y[1];
		x[0]=x[1]-x[0];
		y[0]=y[1]-y[0];
		sort(star,star+n,cmp);
		x[1]=star[1].x-star[0].x;
		y[1]=star[1].y-star[0].y;
		double ans=LineAngle(x[0],y[0],x[1],y[1]);
		printf("%.3lf\n",ans);
	}
	return 0;
}


你可能感兴趣的:(算法)