fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main(void) {
  4. double x1,y1,x2,y2;
  5. double distancia;
  6. scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
  7. distancia = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
  8. printf("%.4f\n", distancia);
  9. return 0;
  10. }
  11.  
Success #stdin #stdout 0s 4284KB
stdin
-2.5 0.4
12.1 7.3
stdout
16.1484