blob: 8ea2b02c842f6c4223770e03b3bd7095c6dcad05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
}
|