summaryrefslogtreecommitdiff
path: root/7p7.cpp
diff options
context:
space:
mode:
Diffstat (limited to '7p7.cpp')
-rw-r--r--7p7.cpp31
1 files changed, 31 insertions, 0 deletions
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 <iostream>
+#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;
+}