diff options
author | Oskar <[email protected]> | 2024-09-18 16:12:27 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-09-18 16:12:27 +0200 |
commit | a10a6e35975660b89b465faf5baacd6df9c43a34 (patch) | |
tree | 7338cdde8a865904118be77dba5d6db949785680 /7p13.cpp | |
parent | 46dd78806ebac69c88cb07cecb3afae1835b783a (diff) |
more, 7.15 not started yet
Diffstat (limited to '7p13.cpp')
-rw-r--r-- | 7p13.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/7p13.cpp b/7p13.cpp new file mode 100644 index 0000000..bfacb6a --- /dev/null +++ b/7p13.cpp @@ -0,0 +1,34 @@ +#include <iostream> +#include "sales_data.hpp" + +/* + * + * 7.13 + * + * + */ + +int main () { + + SalesData total(std::cin); + if (std::cin) { + SalesData trans(std::cin); + while(std::cin) { + if (total.isbn() == trans.isbn()) + total.combine(trans); + else { + print(std::cout, total) << std::endl; + total = trans; + } + + read(std::cin, trans); + } + + print(std::cout, total) << std::endl; + } else { + std::cerr << "Error" << std::endl; + return -1; + } + + return 0; +} |