1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include <iostream> #include "sales_item.hpp" /* * Exercise 1.22 * * * */ int main () { Sales_item item1; Sales_item sum; if(std::cin >> sum) { while(std::cin >> item1) { sum += item1; } std::cout << sum << std::endl; } return 0; }