#include<stdio.h>
#include<string.h>
#define N 100000+10
int main()
{
char s[N];
int l, i, sum, ans0, ans1;
l = i = sum = ans0 = ans1 = 0;
gets(s);
l = strlen(s);
i = 0;
while (i<l)
{
if (s[i] >= 'a'&&s[i] <= 'z')
sum = sum + (s[i] - 'a' + 1);
if (s[i] >= 'A'&&s[i] <= 'Z')
sum = sum + (s[i] - 'A' + 1);
i++;
}
while (sum != 0)
{
if (sum % 2 == 1)
ans1++;
else
ans0++;
sum /= 2;
}
printf("%d %d\n", ans0, ans1);
system("pause");
return 0;
}
1057
最新推荐文章于 2024-07-31 10:34:18 发布