现在的位置: 首页 > 综合 > 正文

hdoj2547

2019年07月31日 ⁄ 综合 ⁄ 共 332字 ⁄ 字号 评论关闭

http://acm.hdu.edu.cn/showproblem.php?pid=2547

//水题
#include <iostream>
#include <cmath>
using namespace std;

double func(double x, double y, double m, double n)
{
 return (sqrt(x*x + y*y + m*m + n*n - 2*m*x - 2*n*y));
}

int main()
{
 int t;
 double a, b, c, d;
 cin >> t;
 while (t--) {
  cin >> a >> b >> c >> d;
  printf("%.1lf\n", func((a+c)/2,(b+d)/2, a, b)+func((a+c)/2,(b+d)/2, c, d) );
 }
 return 0;
}

 

【上篇】
【下篇】

抱歉!评论已关闭.