POB_2019/Figures/source/main.cpp

19 lines
388 B
C++
Raw Normal View History

2019-05-13 20:54:13 +02:00
#include "../include/Circle.h"
#include "../include/Rectangle.h"
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<Figure*> figures = {
(Figure*)new Rectangle(10, 2),
(Figure*)new Rectangle(3, 3),
(Figure*)new Circle(5),
(Figure*)new Circle(1)
};
for (Figure *f : figures) {
cout << f->type() << ": area = " << f->area() << "\n";
}
return 0;
}