在这代码里我没有包含
却可以使用islower()和isupper()
#include
int main()
{
int n=0, m=0;
char ch;
while ((ch = getchar()) != '\n')
{
if (islower(ch))
n++;
else if (isupper(ch))
m++;
}
printf("The number of lower is %d\n", n);
printf("THe number of upper is %d",m);
return 0;
}
一些编译器有自动包含一些头的功能,也可以在编译选项中定义,gcc就不要包含
我这里必须包含
#include <ctype.h>