#include using namespace std; int main() { char tmp; int shotCount = 0; int actualSum =0; while((tmp = fgetc(stdin)) != EOF) { if(tmp == '|'){ shotCount++; while((tmp = fgetc(stdin)) == '|') shotCount++; actualSum += 42 * shotCount; shotCount = 0; continue; } if(isalnum(tmp)) { int tmpCount = tmp - '0'; while(isalnum(tmp = fgetc(stdin))) { tmpCount *= 10; tmpCount += tmp - '0'; } fgetc(stdin); while((tmp = fgetc(stdin)) == '|') shotCount++; actualSum += tmpCount * shotCount; tmpCount = 0; shotCount = 0; continue; } } //if (actualSum % 10 >= 5) { actualSum += 10 - actualSum % 10; /*} else { actualSum -= actualSum % 10; }*/ cout << actualSum << ",-" <