fork download
  1. #include "stdio.h"
  2. #include "math.h"
  3. int main()
  4. {
  5. double x1,y1,x2,y2,z;
  6. while(scanf("%lf %lf %lf %lf", &x1,&y1,&x2,&y2)!=EOF){
  7. z=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
  8. printf("%.2lf\n",z);
  9. }
  10. return 0;
  11. }
  12.  
  13.  
Success #stdin #stdout 0s 2172KB
stdin
1 0 0 1
1 1 0 0
stdout
1.41
1.41