summaryrefslogtreecommitdiff
path: root/2.42-v2.cpp
blob: f7d22611d62e8eeb5e62f8ee04f60240ac4f2a00 (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
#include <iostream>
#include "sales_data.hpp"

/*
 *
 * 2.41 - 1.21
 *
 *
 */

int main () {
	
	SalesData book1;
	SalesData book2;
	while(std::cin >> book1.BookNo >> book1.UnitsSold >> book1.Revenue) {
		std::cin >> book2.BookNo >> book2.UnitsSold >> book2.Revenue;
		if(book1.BookNo != book2.BookNo) {
			std::cout << "These books do not have the same ISBN" << std::endl;
			continue;
		}
		
		std::cout << book1.BookNo << " " << book1.UnitsSold + book2.UnitsSold << " " << book1.Revenue + book2.Revenue << std::endl;
	}
	
	return 0;
}