fork download
  1.  
  2. #include <iostream>
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. double distance(int x1, int y1, int x2, int y2)
  7. {
  8. double z = pow(x2-x1, 2),n,j;
  9. double v = pow(y2-y1, 2);
  10. j = z+v;
  11. n = pow(j, 0.5);
  12. return n;
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18. int a,b,c,d;
  19. cin >> a >> b >> c >> d;
  20. cout << distance(a,b,c,d);
  21.  
  22.  
  23. return 0;
  24. }
  25.  
  26.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
7.4283e+08