Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- bool compare(int k1, int k2) {
- bool res;
- if (k1 == k2) res = true;
- else res = false;
- return res; }
- int main() {
- int x1,x2,x3,x4,y1,y2,y3,y4, k1, k2, b1,b2;
- bool res, res2;
- std::cin >> x1 >> y1 >> x2 >> y2;
- std::cin >> x3 >> y3 >> x4 >> y4;
- k1 = (y1-y2)*(x3-x4);
- k2 = (y3-y4)*(x1-x2);
- b1 = (x3 - x4)*(y1*(x1 - x2) - x1*(y1 - y2));
- b2 = (x1 - x2)*(y3*(x3 - x4) - x3*(y3 - y4));
- res = compare(k1, k2);
- res2 = compare(b1, b2);
- std::cout << res <<' ' << res2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement