字符类型判断
来源:互联网 发布:跑步记录软件 编辑:程序博客网 时间:2024/06/05 05:37
题目内容:
从键盘键入任意一个字符,判断该字符是英文字母(不区分大、小写)、数字字符还是其它字符。
若键入字母,则屏幕显示 It is an English character.;若键入数字则屏幕显示It is a digit character. ;若输入其它字符,则屏幕显示:It is other character.
程序的运行示例1:
Input simple:
b↙
It is an English character.
程序的运行示例2:
Input simple:
6↙
It is a digit character.
程序的运行示例3:
Input simple:
*↙
It is other character.
程序的运行示例4:
Input simple:
A↙
It is an English character.
输入信息提示:”Input simple:\n”
输入格式: “%c”
输出格式:
英文字符的输出格式:”It is an English character.\n”
数字的输出格式:”It is a digit character.\n”
其它字符的输出格式:”It is other character.\n”
#include <stdio.h>#include <ctype.h>int main(){ printf("Input simple:\n"); char ch; ch=getchar(); if(isalpha(ch))printf("It is an English character.\n"); else if(isalnum(ch))printf("It is a digit character.\n"); else printf("It is other character.\n"); return 0;}
#include<stdio.h>int main(){ char c; printf("Input simple:"); scanf("%c",&c); if(c>='a'&&c<='z'||c>='A'&&c<='Z') printf("It is an English character."); else if(c>='0'&&c<='9') printf("It is a digit character."); else printf("It is other character."); return 0;}
0 0
- 字符类型判断
- 1026: 字符类型判断
- 1149判断字符类型
- 判断字符类型部分方法
- 1049 单个字符类型判断
- python判断unicode字符类型
- python 判断unicode字符类型
- 输入字符类型的半判断
- PHP 判断字符类型,并转换返回
- SQL判断字符类型是否为数字
- 判断字符型可否转为其他类型
- python中如何判断字符类型
- cctype函数 (字符类型判断)
- 第四周——字符类型判断
- zzuli OJ 1026: 字符类型判断
- 从键盘输入一个字符,判断其类型
- JS判断字符是否为数字类型
- Unity char字符类型的判断
- windows redis安装
- vim的常用操作
- Android四大组件之Service
- position相关问题的思考
- C++线程类
- 字符类型判断
- scrapy URLerror:<urlopen error [Error 10051]> 问题
- 关闭Tomcat
- sgafhdhdsfhsdfhsdh
- 前后端分离的思考
- 手动更新系统补丁时,windows update一直卡住解决方法
- 调整Eclipse字体大小
- Windows server 2008 配置一个Ftp步骤
- C# Activator和new的区别