#include<stdio.h> void check(char x); int main() { char ch; printf("请输入一个字符:"); ch=getchar(); check(ch);//函数调用 return 0; } void check(char x) { if(x>'0'&&x<='9') { printf("是数字!\n"); } else if(x>='a'&&x<='z'||x>='A'&&x<='Z') { printf("是字母!\n"); } else if(x==' ') { printf("是空格!\n"); } else { printf("是其它字符!\n"); } }