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 /7p7.cpp | |
parent | 46dd78806ebac69c88cb07cecb3afae1835b783a (diff) |
more, 7.15 not started yet
Diffstat (limited to '7p7.cpp')
-rw-r--r-- | 7p7.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -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; +} |