淡泊明志 宁静致远
分类: C/C++
2006-12-08 22:40:34
【C语言库函数源代码】
【本程序在Dev C++ 4.9.9.2 下编译通过】
int my_islower ( int ch )
{
return (unsigned int) (ch -
'a') < 26u;
}//判断字符c是否为小写英文字母
int main()
{
char ch =
'c';
if(my_islower(ch))
printf("%c is Lower English
Character!\n",ch);
else
printf("%c is not a Lower English
Character!\n",ch);
ch = 'A';
if(my_islower(ch))
printf("%c is Lower English
Character!\n",ch);
else
printf("%c is not a Lower English
Character!\n",ch);
system("pause");
return 0;
}