solution.cpp 553 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
    string str;
    cin >> str;
    int A = 0, a = 0, number = 0;
    int len = str.length();
    for (int i = 0; i < len; i++)
    {
        if (str[i] <= '9' && str[i] >= '0')
        {
            number++;
        }
        if (str[i] <= 'Z' && str[i] >= 'A')
        {
            A++;
        }
        if (str[i] <= 'z' && str[i] >= 'a')
        {
            a++;
        }
    }
    cout << A << endl;
    cout << a << endl;
    cout << number << endl;
    return 0;
}