南阳oj 两点距离

#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main ()
{
int t;
cin>>t;
while(t--)
{
double x1,x2,y1,y2;
cin>>x1>>y1>>x2>>y2;
double a=(x1-x2)*(x1-x2);
double b=(y1-y2)*(y1-y2);
double c=sqrt(a+b);
printf("%.2lf\n",c);
}
return 0;
}

记得包含头文件<math.h>

注意输出格式

posted @ 2018-07-25 15:02  换牙  阅读(88)  评论(0编辑  收藏  举报