#include <stdio.h>
int keyNum[26] = {1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,4,1,2,3,1,2,3,4};
int count;
char str[101];
void Counter(char ch)
{
if (ch == ' ') count ++;
count += keyNum[ch - 'a'];
}
int main()
{
int n = 1, i, j;
scanf("%d", &n);
getchar();
for (j = 1; j <= n; j ++)
{
gets(str);
count = 0;
for (i = 0; str[i]; i ++)
Counter(str[i]);
printf("Case #%d: %d\n",j , count);
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言