Timus Problem 1567 Solution
#include <stdio.h> int main() { char c; int i,sum=0; while(scanf("%c",&c)==1){ if(c=='a') sum+=1; else if(c=='b') sum+=2; else if(c=='c') sum+=3; else if(c=='d') sum+=1; else if(c=='e') sum+=2; else if(c=='f') sum+=3; else if(c=='g') sum+=1; else if(c=='h') sum+=2; else if(c=='i') sum+=3; else if(c=='j') sum+=1; else if(c=='k') sum+=2; else if(c=='l') sum+=3; else if(c=='m') sum+=1; else if(c=='n') sum+=2; else if(c=='o') sum+=3; else if(c=='p') sum+=1; else if(c=='q') sum+=2; else if(c=='r') sum+=3; else if(c=='s') sum+=1; else if(c=='t') sum+=2; else if(c=='u') sum+=3; else if(c=='v') sum+=1; else if(c=='w') sum+=2; else if(c=='x') sum+=3; else if(c=='y') sum+=1; else if(c=='z') sum+=2; else if(c=='.') sum+=1; else if(c==',') sum+=2; else if(c=='!') sum+=3; else if(c==' ') sum+=1; } printf("%d",sum); return 0; }