1
2
3
4
5
6
7
8
9
|
#include "Box.h"
#include <iostream>
int main() {
Box plovdivBox("PlovdivBox", { "Magnet", "Book" }, { new Box("ArtBox", {}, { new Box("Drawings", { "OldPlovdiv" }, {}) }), new Box("TheatreBox", {}, { new Box("TheatreSouvenirs", {}, { new Box("Plates", { "DecorativePlate" }, {}), new Box("Bags", {}, {}) }) })});
plovdivBox.print(std::cout) << std::endl;
plovdivBox.removeUselessSubBoxes();
plovdivBox.print(std::cout) << std::endl;
}
|