用VC++编程2
给定程序的功能是分别统计字符串中大写字母和小写字母的个数。例如,给字符串ss输入:AaaaBBb123CCccccd,则输出结果应为:upper=5,lower=9。注意:部分源程序给出如下。请写出fun函数的内容。
试题程序:
#include <stdio.h>
void fun ( char *s, int *a, int *b )
{
}
main( )
{
char str[100];
int upper = 0, lower = 0 ;
printf("\n请输入一个字符串:" );
scanf("%s",str);
fun ( str, & upper, &lower );
printf( "\n upper = %d lower = %d\n", upper,lower );
}