Anonymous
// finding the distance between two points
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
class point2;
class point1
{
int a, b;
public:
point1(int, int);
friend void add(point1, point2);
};
class point2
{
int x, y;
public:
point2(int, int);
friend void add(point1, point2);
};
void add(point1 p1, point2 p2)
{
cout << " the distance between two point is "
<< sqrt(((p1.a - p2.x) * (p1.a - p2.x)) + ((p1.b - p2.y) * (p1.b - p2.y)));
}
point1 ::point1(int x, int y)
{
cout << " enter point2 x : ";
cin >> x;
a = x;
cout << " enter point2 y : ";
cin >> y;
b = y;
}
point2 ::point2(int a, int b)
{
cout << " enter point1 a : ";
cin >> a;
x = a;
cout << " enter point1 b : ";
cin >> b;
y = b;
}
int main()
{
point1 a1();
point2 a2();
cout << endl;
add(a1(), a2());
cout << endl;
cout << endl
<< " Hello Peter :) ";
}
ᴹᵒʰᵃᵐᵐᵃᵈ
Hello
I wrote the list of neighbors in the file, I want to give the c outline of the origin and destination to say whether there is a ridge between them, in your opinion, what is the best way to understand whether there is a ridge between them or not?
I wrote the list of neighbors like this:
0: [20, 26, 2, 19, 28, 25, 14, 39, 23, 21, 43, 17, 24, 0, 11, 13, 15, 12, 18, 44, 16, 22]
1: [20, 26, 19, 28, 39, 14, 23, 10, 21, 43, 17, 53, 24, 0, 11, 13, 33, 15, 12, 18, 44, 29, 16, 22, 6]
2: [4, 26, 58, 3, 9, 1, 44, 6, 2]