#include #include int Dalijeslovo(char c) { if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) return 1; return 0; } int Dalijeveliko(char c) { if(c>='A'&& c<='Z') return 1; return 0; } int Dalijemalo(char c) { if(c>='a' && c<='z') return 1; return 0; } int main() { char rec[300],c,preth; int i,br,j,s; c=getchar(); preth='\n'; while(c!=EOF) { if(Dalijeveliko(c)&& !Dalijeslovo(preth)) { rec[0]=c; preth=c; i=1; br=1; s=c-'A'+1; while(((c=getchar())!=EOF) && !(Dalijemalo(c) && !Dalijeslovo(preth))) { rec[i]=c; if(Dalijeveliko(c)&& !Dalijeslovo(preth)) { br++; s+=c-'A'+1; } i++; preth=c; } rec[i]='\0'; if(br > 1) printf(" %d ",s); else for(j=0;rec[j]!='\0';j++) putchar(rec[j]); if(c!=EOF) putchar(c); } else putchar(c); preth=c; if(c!=EOF) c=getchar(); } system("PAUSE"); return 0; }