The distance between two points

The distance between two points

Insert picture description here

#include <stdio.h>
#include <math.h>
int main()
{
 float x1,y1,x2,y2,l;
 x1=x2=y1=y2=0;
 while(scanf("%f%f",&x1,&y1,&x2,&y2)!=EOF);
 {
  l=fabs(sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));
  printf("%0.2f\n",l);
 }
 return 0; 

Guess you like

Origin blog.csdn.net/weixin_44192389/article/details/88908444