Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- int a = 0, b = 0, c = 0, d = 0, x = 0, y = 0;
- float x1 = 0, y1 = 0;
- cout << "Podaj wspolrzedne punktu A "<<endl;
- cin >> a; cin>> b;
- cout << "Podaj wspolrzedne punktu B" << endl;
- cin >> c; cin >> d;
- x = pow(a, 2) + pow(b, 2);
- x1=sqrt(x);
- y = pow(c, 2) + pow(d, 2);
- y1 = sqrt(y);
- if ((x1 - y1) >= 0) {
- cout << (x1 - y1) << endl;
- }
- if ((x1 - y1) < 0) {
- cout << (y1 - x1) << endl;
- }
- retur 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement