#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main(){
string str;
int sum, a[2] = {0};
getline(cin, str);
for(int i = 0; i < str.length(); i++){
if((str[i] >= 'A' && str[i] <= 'Z' )||(str[i] >= 'a' && str[i] <= 'z')){
if(str[i] >= 'a' && str[i] <= 'z' ){
str[i] = toupper(str[i]);
}
sum += str[i] - 'A' + 1;
}
}
while(sum){
if(sum % 2 == 0) a[0]++;
else if(sum %2 == 1) a[1]++;
sum /= 2;
}
printf("%d %d", a[0], a[1]);
return 0;
}
C语言程序设计-1057 数零壹
最新推荐文章于 2024-03-11 16:29:19 发布