#include #include using namespace std; char s[101]; int main() { int tip,total,nr,i,subtotal; while (cin.getline(s,101)) { total=0; if (s[0]=='u') strcpy(s,s+9); if (s[0]=='c') { tip=1; strcpy(s,s+5); } if (s[0]=='s') { tip=2; strcpy(s,s+6); } if (s[0]=='i') { tip=4; strcpy(s,s+4); } //acum am declaratii de variabile // p=strtok(s,", "); // if (*(p+strlen(p)-1)!=']') total+=tip; // else // { // while (*p!=NULL) // { // // } // } for (i=0; i<=strlen(s); i++) { subtotal=tip; while (s[i]=='[') { nr=0; //subtotal=1; i++; while (s[i]!=']') { nr=nr*10 + s[i]-'0'; i++; } i++; subtotal*=nr; } if (s[i]==',') {total+=subtotal; subtotal=0; continue;} if (s[i]==0) {total+=subtotal; break;} } cout<