#include<stdio.h>
#include<string.h>
int main()
{
char str[100],ch;
int count,i,p,test,l;
scanf("%d",&test);
getchar();
for(l=1;l<=test;l++)
{
count=0;
gets(str);
i=strlen(str);
for(p=0;p<=i;p++)
{
if((str[p]=='a')||(str[p]=='d')||(str[p]=='g')||(str[p]=='j')||(str[p]=='m')||(str[p]=='p')||(str[p]=='t')||(str[p]=='w')||(str[p]==' '))
count=count+1;
else if((str[p]=='b')||(str[p]=='e')||(str[p]=='h')||(str[p]=='k')||(str[p]=='n')||(str[p]=='q')||(str[p]=='u')||(str[p]=='x'))
count=count+2;
else if((str[p]=='c')||(str[p]=='f')||(str[p]=='i')||(str[p]=='l')||(str[p]=='o') ||(str[p]=='r')||(str[p]=='v')||(str[p]=='y'))
count=count+3;
else if((str[p]=='s')||(str[p]=='z'))
count=count+4;
}
printf("Case #%d: %d\n",l,count);
}
return 0;
}
No comments:
Post a Comment