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
#include <iostream> #include "sales_item.hpp" /* * * 1.5.2 example * * */ int main() { Sales_item item1, item2; std::cin >> item1 >> item2; if (item1.isbn() == item2.isbn()) { std::cout << item1 + item2 << std::endl; return 0; } else { std::cerr << "Data must refer to same ISBN" << std::endl; return -1; } return 0; }