#include "stdafx.h"
#include "string.h"
int main()
{
char a[100] = {0};
int len, i, c_letters = 0, c_blocks = 0,c_nums=0,c_others=0;
gets_s(a, sizeof(a)); // gets(a);
len = strlen(a);
for (i = 0; i < len; i++)
{
if ((a[i] >= 'a'&&a[i] <= 'z') || (a[i] >= 'A'&&a[i] <= 'Z'))
c_letters++;
else if (a[i] == ' ')
c_blocks++;
else if ((a[i] >= '0'&&a[i] <= '9'))
c_nums++;
else
c_others++;
}
printf("%d\n", c_letters);
printf("%d\n", c_blocks);
printf("%d\n", c_nums);
printf("%d\n", c_others);
return 0;
}
0.0分
0 人评分