diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..465ef86 --- /dev/null +++ b/main.cpp @@ -0,0 +1,158 @@ +#include +#include "string" +#include "vector" +#include "math.h" +using namespace std; +class Shape; +class rect; +class Right_triangle; +class circle; +class square; +class Shape{ +public: + virtual double surface()=0; + virtual void draw()=0; +}; + +class ListShape{ +protected: + + vectorlist_of_shape; +public: + ListShape(){} + Shape* find(double S){ + for (auto i=list_of_shape.begin(); i surface()==S) { + return *i; + } + } + cout<<"Not Found."<draw(); + cout<surface()>(*j)->surface()) { + Shape* temp=*i; + *i=*j; + *j=temp; + + } + + } + } + } +}; + +class rect:public Shape,public ListShape{ + int x,y,s; +public: + void draw(){ + cout<<"I am a rectangle with leghnt and width ("<draw(); +l.remove(&d); +l.find(16); +cout<surface()<