习题5.8
来源:互联网 发布:数据库原理 编辑:程序博客网 时间:2024/05/17 02:07
#include<stdio.h>main(){ char ch; printf("输入一个字符\n:"); scanf("%d",&ch); if(ch>=97&&ch<=122) { printf("该字符为小写字母"); printf("ch=%c\n",ch); } else if(ch>=65&&ch<=90) { printf("该字符为大写字母"); printf("ch=%c\n",ch); } else if(ch>=48&&ch<=57) { printf("该字符为数字"); printf("ch=%c\n",ch); } else if(ch==32) { printf("该字符为空格"); } else { printf("该字符为其他字符"); } }
阅读全文
0 0