//函数int my_isalpha(char c)的功能是返回字符种类
//大写字母返回1,小写字母返回-1.其它字符返回0
//void a 调用my_isalpha(),返回大写,输出*;返回小写,输出#;其它,输出?
#include<stdio.h>
int my_isalpha(int b)
{if (b >= 65 && b <= 90)return 1;else if (b >= 97 && b <= 122)return -1;elsereturn 0;
}
void a(int c)
{if (c == 1)printf("*\n");else if (c == -1)printf("#\n");else if (c == 0)printf("?\n");elseprintf("\n");
}
int main()
{char b;printf("请输入一个字符:");scanf("%c",&b);int c=my_isalpha(b);a(c);return 0;
}
输出结果: