//打个表。虽然我承认这个表并不太好。 #include <stdio.h> #include <string.h> int sum; void tj(char ch) { if(ch=='a'||ch=='d'||ch=='g'||ch=='j'||ch=='m'||ch=='p'||ch=='t'||ch=='w'||ch==' ') sum++; if(ch=='b'||ch=='e'||ch=='h'||ch=='k'||ch=='n'||ch=='q'||ch=='u'||ch=='x') sum+=2; if(ch=='c'||ch=='f'||ch=='i'||ch=='l'||ch=='o'||ch=='r'||ch=='v'||ch=='y') sum+=3; if(ch=='s'||ch=='z') sum+=4; } int main() { sum=0; char in[201]={0}; gets(in); int i; for(i=0;in[i]!=0;i++) tj(in[i]); printf("%d",sum); return 0; }