Advertisement
Henry-Galleguillos

Distancias

Mar 29th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. float xa,xb,ya,yb,d,q,w,e,r,t,m;
  8. cout << "CINTA METRICA VIRTUAL \n";
  9. cout << "::::::::::::::::::::: \n";
  10. cout << "Ingrese Punto 1 \n";
  11. cout << "X: ";
  12. cin >> xa;
  13. cout << "Y: ";
  14. cin >> ya;
  15. cout << "Ingrese Punto 2 \n";
  16. cout << "X: ";
  17. cin >> xb;
  18. cout << "Y: ";
  19. cin >> yb;
  20. q = xa-xb;
  21. w = ya-yb;
  22. e = pow(q,2);
  23. r = pow(w,2);
  24. t = e+r;
  25. d = sqrt (t);
  26. cout << "::::::::::::::::::::: \n";
  27. cout << "Distancia: " <<d <<endl;
  28. cout << "::::::::::::::::::::: \n";
  29. cout << "Presione 'm' para salir\n";
  30. cin >> m;
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement