From a10a6e35975660b89b465faf5baacd6df9c43a34 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 18 Sep 2024 16:12:27 +0200 Subject: more, 7.15 not started yet --- 7p7.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 7p7.cpp (limited to '7p7.cpp') diff --git a/7p7.cpp b/7p7.cpp new file mode 100644 index 0000000..8ea2b02 --- /dev/null +++ b/7p7.cpp @@ -0,0 +1,31 @@ +#include +#include "sales_data.hpp" + +/* + * + * 7.7 + * + * + */ + +int main () { + + SalesData CurItem; + if(read(std::cin, CurItem)) { + SalesData Item; + while(read(std::cin, Item)) { + if(Item.isbn() == CurItem.isbn()) { + CurItem.combine(Item); + } else { + print(std::cout, CurItem); + std::cout << std::endl; + CurItem = Item; + } + } + + print(std::cout, CurItem); + std::cout << std::endl; + } + + return 0; +} -- cgit v1.2.3