Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cctype>
  4. #include<cstring>
  5. #include<cstdlib>
  6. #include<cmath>
  7. #include<string>
  8. #include<algorithm>
  9. using namespace std;
  10. int main()
  11. {
  12. char ar[100],i,j;
  13. int t,k,count;
  14. cin>>t;
  15. scanf("\n");
  16. for(k=1;k<=t;k++){
  17. count=0;
  18. gets(ar);
  19. int length=strlen(ar);
  20. for(int j=0;j<length;j++){
  21. if(ar[j]=='a'||ar[j]=='d'||ar[j]=='g'||ar[j]=='j'||ar[j]=='m'||ar[j]=='p'||ar[j]=='t'||ar[j]=='w'||ar[j]==32)
  22. count=count+1;
  23. else if(ar[j]=='b'||ar[j]=='e'||ar[j]=='h'||ar[j]=='k'||ar[j]=='n'||ar[j]=='q'||ar[j]=='u'||ar[j]=='x')
  24. count=count+2;
  25. else if(ar[j]=='c'||ar[j]=='f'||ar[j]=='i'||ar[j]=='l'||ar[j]=='o'||ar[j]=='r'||ar[j]=='v'||ar[j]=='y')
  26. count=count+3;
  27. else if(ar[j]=='s'||ar[j]=='z')
  28. count=count+4;
  29. }
  30. printf("Case #%d: %d\n",k,count);
  31. }return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement