Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- float xa,xb,ya,yb,d,q,w,e,r,t,m;
- cout << "CINTA METRICA VIRTUAL \n";
- cout << "::::::::::::::::::::: \n";
- cout << "Ingrese Punto 1 \n";
- cout << "X: ";
- cin >> xa;
- cout << "Y: ";
- cin >> ya;
- cout << "Ingrese Punto 2 \n";
- cout << "X: ";
- cin >> xb;
- cout << "Y: ";
- cin >> yb;
- q = xa-xb;
- w = ya-yb;
- e = pow(q,2);
- r = pow(w,2);
- t = e+r;
- d = sqrt (t);
- cout << "::::::::::::::::::::: \n";
- cout << "Distancia: " <<d <<endl;
- cout << "::::::::::::::::::::: \n";
- cout << "Presione 'm' para salir\n";
- cin >> m;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement