#include #include using namespace std; int main() { int price = 0; int count = 0; int billTotal = 0; while (true) { price = 0; count = 0; cin >> price; if (price == 0) { price = 42; } string line; cin.clear(); // std::getline(cin, line); if (!std::getline(cin, line)) { break; } for (char c : line) { if (c == '|') { count++; } } int total = price * count; billTotal += total; } int leftOver = billTotal % 10; if (billTotal % 10 != 0) billTotal += 10 - leftOver; std::cout << billTotal << ",-" << std::endl; return 0; }