From 676958c562310140125b0323071ce0abd5f0d393 Mon Sep 17 00:00:00 2001 From: angeld55 Date: Sun, 23 May 2021 15:48:25 +0300 Subject: sem 13 --- Sem. 13/Figures/main.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Sem. 13/Figures/main.cpp (limited to 'Sem. 13/Figures/main.cpp') diff --git a/Sem. 13/Figures/main.cpp b/Sem. 13/Figures/main.cpp new file mode 100644 index 0000000..7e9f9ff --- /dev/null +++ b/Sem. 13/Figures/main.cpp @@ -0,0 +1,36 @@ +#include +using namespace std; + +#include "Rectangle.h" +#include "Circle.h" +#include "Triangle.h" + + +void printAreas(const Shape* const * shapes, size_t shapesCount) +{ + for (int i = 0; i < shapesCount; i++) + cout << shapes[i]->getArea() <getPer() << endl; +} +int main() +{ + Shape** arr = new Shape*[4]; + + arr[0] = new Rectangle(3, 4, 6, 8); + arr[1] = new Circle(3, 3, 4); + arr[2] = new Circle(1, 4, 5); + arr[3] = new Triangle(1, 1, 2, 2, 3, 3); + + printAreas(arr, 4); + printPers(arr, 4); + + for (int i = 0; i < 4; i++) + delete arr[i]; + delete[] arr; + + +} \ No newline at end of file -- cgit v1.3.1-23-gd82d