2014-c-三-2
#include <stdio.h>
#define maxSize 100
int main()
{
char str[maxSize];//字符串
char *p;//字符指针
int b=0,s=0;//定义大小写数量
p=str;
scanf("%s",str);
//统计个数注意等号
while(*p!='\0')
{
if(*p>='A'&&*p<='Z') ++b;
if(*p>='a'&&*p<='z') ++s;
p++;
}
printf("小写字符个数%d\n",s);
printf("大写字符个数%d\n",b);
p--;//此时指针在\0位置,前移一个位置
while(p>=str)
{
if(*p>='A'&&*p<='Z')
{
printf("%c",*p);
}
p--;
}
}