fork(3) download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int x1, y1;
  9. int x2, y2, z2;
  10. cin >> x1 >> y1;
  11. cin >> x2 >> y2 >> z2;
  12. double D = 1/sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1) + z2*z2);
  13. cout << fixed << setprecision(3) << D << endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3416KB
stdin
10 30
20 40 110
stdout
0.009