|
#include <cctype>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string str;
getline(cin, str);
int alpha = count_if(str.begin(), str.end(), isalpha),
digit = count_if(str.begin(), str.end(), isdigit),
other = str.length() - alpha - digit;
cout << "alpha = " << alpha << endl
<< "digit = " << digit << endl
<< "other = " << other << endl;
return 0;
}
|