#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(){
int num,i,len,sum=0,c1=0,c2=0;
char a[10001];
gets(a);
len=strlen(a);
for(i=0;i<len;i++){
if('a'<=tolower(a[i])&&tolower(a[i])<='z'){//不要写成'a'<=tolower(a[i])<='z'
sum=sum+tolower(a[i])-'a'+1;
}
}
while(sum!=0){
if(sum%2==0) c1++;
else c2++;
sum=sum/2;
}
printf("%d %d",c1,c2);
return 0;
}
PAT考试乙级1057(C语言实现)
最新推荐文章于 2021-09-13 15:39:07 发布