Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Point {
- int x, y;
- Point() {}
- };
- struct GeomitryVector {
- int x, y;
- GeomitryVector() {}
- GeomitryVector(Point A, Point B) {
- x = A.x - B.x;
- y = A.y - B.y;
- }
- int operator * (GeomitryVector &A) {
- return x * A.y - A.x * y;
- }
- };
- bool checkPoint(Point a, Point b, Point c, Point d) {
- GeomitryVector f(a, b);
- GeomitryVector s(a, c);
- GeomitryVector t(a, d);
- return((f*s < 0 && f*t < 0) || (f*s > 0 && f*t > 0));
- }
- int main() {
- Point a, b, c, d;
- cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y;
- if (checkPoint(a, b, c, d)) cout << "Yes";
- else cout << "No";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement