parent
ff59a12173
commit
d91dbe1adc
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
int main()
|
||||
{
|
||||
char str[100];
|
||||
int n, a = 0, b = 0, c = 0, d = 0, e = 0;
|
||||
gets(str);
|
||||
n = strlen(str);
|
||||
for(int i = 0; i < n; i ++)
|
||||
{
|
||||
if(str[i] >='A' && str[i] <= 'Z')
|
||||
a ++;
|
||||
else if(str[i] >= 'a' && str[i] <= 'z')
|
||||
b ++;
|
||||
else if(str[i] >= '0' && str[i] <= '9')
|
||||
c ++;
|
||||
else if(str[i] == ' ')
|
||||
d ++;
|
||||
else
|
||||
e ++;
|
||||
}
|
||||
printf("capital letters:%d\nsmall letters:%d\nblank spaces:%d\nnumbers:%d\nother:%d", a, b, d, c, e);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in new issue