努力ing
你浪费的今天是昨天死去的人所渴望的明天!!!

其实就是求两点的距离

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
	int t;
	double a,b,c,d;
	double min,k1,k2;
	cin>>t;
	while(t--)
	{
		cin>>a>>b>>c>>d;
		if(a>c) k1=(a-c)/2;
		else k1=(c-a)/2;
		if(b>d) k2=(b-d)/2;
		else k2=(d-b)/2;
		min=2*sqrt(k1*k1+k2*k2);
		printf("%.1lf\n",min);
	}
	return 0;
}

 

posted on 2013-06-25 17:53  努力ing  阅读(223)  评论(0)    收藏  举报