From 41da0401b9c8a88f558e1b0fd2d21800c1a534e1 Mon Sep 17 00:00:00 2001 From: Neginkhf <44371337+Neginkhf@users.noreply.github.com> Date: Sun, 11 Nov 2018 21:41:35 +0330 Subject: [PATCH 1/4] Add files via upload --- main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 main.cpp diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..a3a5291 --- /dev/null +++ b/main.cpp @@ -0,0 +1,9 @@ +#include + +int main() { + std::cout << "Hello, World!" << std::endl; + int t=10; + t=8; + int y=9; + return 0; +} \ No newline at end of file From 0aa04494be67ea390604937b14974d37f68a219f Mon Sep 17 00:00:00 2001 From: Neginkhf <44371337+Neginkhf@users.noreply.github.com> Date: Sun, 11 Nov 2018 21:43:15 +0330 Subject: [PATCH 2/4] Update main.cpp --- main.cpp | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 158 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index a3a5291..4dd3e4b 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,162 @@ #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 void add()=0; + virtual double surface()=0; + virtual void draw()=0; + +//protected: + // Shape(){} +}; + +class ListShape{ +protected: + + vectorlist_of_shape; +public: + ListShape(){} + Shape* find(int 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()< Date: Sun, 11 Nov 2018 21:44:15 +0330 Subject: [PATCH 3/4] Update main.cpp --- main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main.cpp b/main.cpp index 4dd3e4b..efa9aa4 100644 --- a/main.cpp +++ b/main.cpp @@ -10,12 +10,8 @@ class circle; class square; class Shape{ public: - //virtual void add()=0; virtual double surface()=0; virtual void draw()=0; - -//protected: - // Shape(){} }; class ListShape{ From e5f63eee130d1c84cc70f78a556f0b25444e65ce Mon Sep 17 00:00:00 2001 From: Neginkhf <44371337+Neginkhf@users.noreply.github.com> Date: Sun, 11 Nov 2018 22:02:31 +0330 Subject: [PATCH 4/4] Update main.cpp --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index efa9aa4..465ef86 100644 --- a/main.cpp +++ b/main.cpp @@ -20,7 +20,7 @@ class ListShape{ vectorlist_of_shape; public: ListShape(){} - Shape* find(int S){ + Shape* find(double S){ for (auto i=list_of_shape.begin(); i surface()==S) { return *i;