Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <cmath>
- #include <cstdio>
- double lenght(int x1, int y1, int x2, int y2)
- {
- }
- class CShape
- {
- public:
- CShape();
- ~CShape();
- virtual void Area() = 0;
- virtual void IsPointInside() = 0;
- };
- CShape::CShape()
- {
- }
- CShape::~CShape()
- {
- }
- class CRect: public CShape
- {
- public:
- CRect() : CShape() {};
- ~CRect();
- void Area() { printf("%d\n", (right - left) * (bottom - top)); }
- void IsPointInside(int x, int y)
- {
- if (x >= left && x <= right && y >= bottom && y <= top)
- printf("YES\n");
- else
- printf("NO\n");
- }
- private:
- int top;
- int left;
- int bottom;
- int right;
- };
- CRect::CRect() : CShape()
- {
- }
- CRect::~CRect()
- {
- }
- class CCircle: public CShape
- {
- public:
- CCircle() : CShape() {};
- ~CCircle();
- void Area() { printf("%d\n", rad * rad * M_PI); }
- void IsPointInside(int x, int y)
- {
- double len = length(x, y, xc, yc);
- }
- private:
- int xc;
- int yc;
- double rad;
- };
- CCircle::CCircle() : CShape()
- {
- }
- CCircle::~CCircle()
- {
- }
- class CTriangle:public CShape
- {
- public:
- CTriangle() : CShape() {};
- ~CTriangle();
- void Area() { printf("\n"); }
- private:
- int x1;
- int y1;
- int x2;
- int y2;
- int x3;
- int y3;
- };
- CTriangle::CTriangle() :CShape()
- {
- }
- CTriangle::~CTriangle()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment