Skip to content

Commit

Permalink
formatting for ex1_22
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Jun 22, 2015
1 parent 20b2d61 commit a1b2dcf
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions ch01/ex1_22.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@

int main()
{
Sales_item total;
if (std::cin >> total)
{
Sales_item trans;
while (std::cin >> trans)
{
if (total.isbn() == trans.isbn())
total += trans;
else
{
Sales_item total;
if (std::cin >> total) {
Sales_item trans;
while (std::cin >> trans) {
if (total.isbn() == trans.isbn())
total += trans;
else {
std::cout << total << std::endl;
total = trans;
}
}
std::cout << total << std::endl;
total = trans;
}
}
std::cout << total << std::endl;
}
else
{
std::cerr << "No data?!" << std::endl;
return -1;
}
else {
std::cerr << "No data?!" << std::endl;
return -1;
}

return 0;
return 0;
}

0 comments on commit a1b2dcf

Please sign in to comment.