#include #include #include using namespace std; ifstream f("mian.in"); char v[105]; int main() { f.getline(v,101); while(v[0]) { int s=0; int rap=1,ok=1; char *p; p=strstr(v,"char"); if(p) { rap=1; ok=0; } if(ok==1) p=strstr(v,"short"); if(p && ok==1) { rap=2; ok=0; } if(ok==1) p=strstr(v,"int"); if(p && ok==1) { rap=4; } p=strstr(p," "); int pro=1; for(int i=0;i='0') { nr=nr*10 + p[i]-'0'; ++i; } pro*=nr; } if(p[i]==',') { s+=rap*pro; pro=1; } } s+=rap*pro; cout<