Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- #include<cctype>
- #include<cstring>
- #include<cstdlib>
- #include<cmath>
- #include<string>
- #include<algorithm>
- using namespace std;
- int main()
- {
- char ar[100],i,j;
- int t,k,count;
- cin>>t;
- scanf("\n");
- for(k=1;k<=t;k++){
- count=0;
- gets(ar);
- int length=strlen(ar);
- for(int j=0;j<length;j++){
- 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)
- count=count+1;
- 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')
- count=count+2;
- 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')
- count=count+3;
- else if(ar[j]=='s'||ar[j]=='z')
- count=count+4;
- }
- printf("Case #%d: %d\n",k,count);
- }return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement