fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4.  
  5. main() {
  6. double dist;
  7. int x1 = 10, x2 = 20, y1 = 30, y2= 50;
  8.  
  9. dist = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
  10. printf("%.2lf", dist);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
22.36