#include #include #include #include const int rake = 42; int main() { int totalPrice = 0; int lines; char str[1010]; while(true) { fgets(str, 1010, stdin); if(strlen(str) == 0 || feof(stdin)) break; lines = 0; for(int i = 0; str[i] != '\0'; i++) { if(str[i] == '|') lines++; } if(lines == 0) lines = 1; if(str[0] == '|') // rake { totalPrice += lines * rake; } else { int price = atoi(str); totalPrice += price * lines; } } if(totalPrice % 10 != 0) totalPrice += 10 - totalPrice % 10; printf("%d,-\n", totalPrice); return 0; }