Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include<stdio.h>
- #include<iostream>
- #include<vector>
- #include<cmath>
- #include<algorithm>
- #include<memory.h>
- #include<map>
- #include<set>
- #include<queue>
- #include<list>
- #include<sstream>
- #include<cstring>
- #include<numeric>
- #include<limits.h>
- using namespace std;
- struct point {
- private: double x, y;
- public:
- point() : x(0), y(0) {}
- point(double x, double y) : x(x), y(y) {}
- void scan() {
- scanf("%lf%lf", &x, &y);
- }
- point operator+ (const point & P) const {
- return point(x + P.x, y + P.y);
- }
- point operator- (const point & P) const {
- return point(x - P.x, y - P.y);
- }
- point operator/ (double k) const {
- return point(x / k, y / k);
- }
- double operator*(const point & p) const {
- return x * p.y - y * p.x;
- }
- };
- double triangleArea(point & A, point & B, point & C) {
- return abs((A - B) * (C - B)) * 0.5;
- }
- double triangleArea(point & A, point & B, point & C) {
- return abs((A - B) * (C - B)) * 0.5;
- }
- point f[3];
- point s[3];
- int main(){
- for (int i = 0; i < 3; i++) {
- f[i].scan();
- }
- for (int i = 0; i < 3; i++) {
- s[i].scan();
- }
- double fs = triangleArea(f[0], f[1], f[2]);
- double ss = triangleArea(s[0], s[1], s[2]);
- if (fs != ss) {
- printf("5");
- return 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement