Files
PAT/PATBasic/1057.c
2022-01-08 03:01:51 +08:00

20 lines
285 B
C

#include <stdio.h>
#include <ctype.h>
int main()
{
char c;
int sum = 0, count[2] = {0};
while ((c = getchar()) != EOF && c != '\n')
if (isalpha(c))
sum += tolower(c) - 'a' + 1;
for (; sum; sum >>= 1)
count[sum & 1]++;
printf("%d %d", count[0], count[1]);
return 0;
}