主题:[讨论]请教高手,给我解决一下。谢谢
#include <stdio.h>
#include <string.h>
#define N 100
int main()
{ int big,small,digita,space,els,i;
char a[N],*p;
p=a;
scanf("%s",p);
big=0;small=0;digita=0;space=0;els=0;
for(i=0;a[i]!='\0';i++)
{
if (a[i]>='A'&& a[i]<='Z')
big=big+1;
else if((a[i]>='a')&&(a[i]<='z'))
small=small+1;
else if((a[i]>='0')&&(a[i]<='9'))
digita++;
else if a[i]=' '
space++;
else els++;
}
printf("big=%d\n",big);
printf("small=%d\n",small);
printf("digita=%d\n",digita);
printf("space=%d\n",space);
printf("els=%d\n",els);
system("pause");
}统计输入字符串中的大写字母、小写字母、空格及其它字符个数
#include <string.h>
#define N 100
int main()
{ int big,small,digita,space,els,i;
char a[N],*p;
p=a;
scanf("%s",p);
big=0;small=0;digita=0;space=0;els=0;
for(i=0;a[i]!='\0';i++)
{
if (a[i]>='A'&& a[i]<='Z')
big=big+1;
else if((a[i]>='a')&&(a[i]<='z'))
small=small+1;
else if((a[i]>='0')&&(a[i]<='9'))
digita++;
else if a[i]=' '
space++;
else els++;
}
printf("big=%d\n",big);
printf("small=%d\n",small);
printf("digita=%d\n",digita);
printf("space=%d\n",space);
printf("els=%d\n",els);
system("pause");
}统计输入字符串中的大写字母、小写字母、空格及其它字符个数