输入4个浮点数x1,y1,x2,y2,输出平面坐标系中点(x1,y1)到点(x2,y2)的距离。
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
int x1,x2,y1,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
printf("%.4f",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));
system("pause");
return EXIT_SUCCESS;
}