#include<stdio.h>
#include<stdlib.h>
int main()
{
char str[1024] = " ";
gets_s(str, 1024);
int size = 0;
while (str[size] != '\0')
size++;
int count[4] = { 0 };
for (int i = 0; str[i] != '\0'; i++)
{
if (str[i] >= '0'&&str[i] <= '9')
{
count[0]++;
}
else if (str[i] == ' ')
{
count[1]++;
}
else if (str[i] >= 'A'&&str[i] <= '9')
{
count[2]++;
}
else if (str[i] >= 'a'&&str[i] <= 'z')
{
count[2]++;
}
else
{
count[3]++;
}
}
printf("数字:%d\t空格:%d\t字母:%d\t其他:%d\t", count[0], count[1], count[2], count[3]);
system("pause");
return 0;
}