1 #include <stdio.h> 2 #include <string.h> 3 #include <ctype.h> 4 5 int main(){ 6 char s[300]; 7 int T; 8 int length; 9 int i; 10 int amount; 11 12 scanf("%d",&T); 13 getchar(); 14 15 while(T--){ 16 gets(s); 17 length=strlen(s); 18 19 amount=0; 20 for(i=0;i<length;i++){ 21 if(islower(s[i])) 22 amount++; 23 } 24 25 amount%=26; 26 27 if(amount==0) 28 printf("z\n"); 29 30 else 31 printf("%c\n",amount-1+‘a‘); 32 } 33 return 0; 34 }
原文:http://www.cnblogs.com/zqxLonely/p/4098223.html