| 4 | import box; |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | std::vector boxes {Box {2.0, 2.0, 3.0}, Box {1.0, 3.0, 2.0}, |
| 9 | Box {1.0, 2.0, 1.0}, Box {2.0, 3.0, 3.0}}; |
| 10 | Box smallBox {boxes[0]}; |
| 11 | for (const auto& box : boxes) |
| 12 | { |
| 13 | if (box < smallBox) smallBox = box; |
| 14 | } |
| 15 | |
| 16 | std::cout << "The smallest box has dimensions " |
| 17 | << smallBox.getLength() << 'x' |
| 18 | << smallBox.getWidth() << 'x' |
| 19 | << smallBox.getHeight() << std::endl; |
| 20 | } |