ADD file via upload

pull/1/head
pi2o8m7nv 3 years ago
parent 4d3a4afcee
commit 1233c52fe1

@ -0,0 +1,26 @@
#include<stdio.h>
void StringCount( char s[] )
{
int a=0,b=0,c=0,d=0,e=0,i;
for(i=0;s[i]!='\0';i++)
{
if('A'<=s[i]&&s[i]<='Z') a++;
else if('a'<=s[i]&&s[i]<='z') b++;
else if(s[i]==' '||s[i]=='\n') c++;
else if('0'<=s[i]&&s[i]<='9') d++;
else e++;
}
printf("%d %d %d %d %d",a,b,d,c,e);
}
int main()
{
char s[10];
gets(s);
StringCount(s);
return 0;
}
Loading…
Cancel
Save